KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVDataPatch_CorrectEtalonModuleIDCode.cpp
Go to the documentation of this file.
1 //Created by KVClassFactory on Thu Jan 30 15:16:45 2014
2 //Author: John Frankland,,,
3 
5 #include <KVINDRAReconNuc.h>
6 #include <KVINDRAReconEvent.h>
7 #include "TClass.h"
8 
10 
11 
12 
16 {
17  // Default constructor
18  SetName(ClassName());
19  SetTitle(Class()->GetTitle());
20 }
21 
22 
23 
26 
28 {
29  // Destructor
30 }
31 
32 
33 
37 
38 Bool_t KVDataPatch_CorrectEtalonModuleIDCode::IsRequired(TString dataset, TString datatype, Int_t, TString dataseries, Int_t datareleasenumber, const TList*)
39 {
40  // Patch is applied to all runs of INDRA 5th campaign 'root' or 'ident' data
41  // written with KaliVeda version 1.8.11
42 
43  return (dataset == "INDRA_camp5"
44  && (datatype == "root" || datatype == "ident")
45  && dataseries == "1.8" && datareleasenumber == 11);
46 }
47 
48 
49 
52 
54 {
55  // Just used to set pointer to current event
57 }
58 
59 
60 
69 
71 {
72  // Patch is applied to all identified particles stopping in the CsI member of
73  // an etalon module which have general ID code 5.
74  // If the CsI identification is available and was succesful, then either
75  // (1) for gammas we set the correct ID code and set the energy = 0
76  // (2) for charged particles we correct the ID code and the energy
77  // which is probably overestimated (due to taking into account the
78  // Si75/SiLi in the calibration when in fact they were not hit)
79 
81  if (N->IsIdentified() && N->GetRingNumber() > 9 && N->StoppedInCsI() && (N->GetSiLi() || N->GetSi75())
82  && N->GetCodes().TestIDCode(kIDCode5)) {
83  KVIdentificationResult* idr = N->GetIdentificationResult(1);
84  if (idr->IDattempted && idr->IsType("CSI_R_L") && idr->IDOK) {
85  if (idr->IDcode == kIDCode0) {
86  // gamma
87  // just set general IDcode gamma and set energy = 0
88  N->SetIdentification(idr, N->GetIdentifyingTelescope());
89  N->SetEnergy(0.);
90  N->GetParameters()->SetValue("KVDataPatch_CorrectEtalonModuleIDCode", "correction applied");
91  }
92  else {
93  // charged particle
94  // needs re-identifying and re-calibrating
96  Bool_t ok = N->CoherencyChIoCsI(ID);
97  if (ok) {
98  N->SetIdentification(&ID, N->GetIdentifyingTelescope());
99  N->Calibrate();
100  N->GetParameters()->SetValue("KVDataPatch_CorrectEtalonModuleIDCode", "correction applied");
101  }
102  else {
103  Warning("ApplyToParticle", "Rustine failed for the following particle:");
104  N->GetParameters()->SetValue("KVDataPatch_CorrectEtalonModuleIDCode", "correction failed");
105  N->Print();
106  }
107  }
108  // update particle's 'OK' status
110  }
111  }
112 }
113 
114 
115 
117 
119 {
120  std::cout << "Correct bad attribution of IDCode & calibration of particles stopping" << std::endl;
121  std::cout << "in CsI detectors behind etalon telescopes." << std::endl;
122  std::cout << "Gammas (IDcode=0) and light charged particles (IDcode=2) were given" << std::endl;
123  std::cout << "IDcode=5 due to a bug in v1.8.11 (lp:bug#1271634)" << std::endl << std::endl;
124  std::cout << "The status of the correction can be obtained from parameter" << std::endl;
125  std::cout << "KVDataPatch_CorrectEtalonModuleIDCode: " << std::endl;
126  std::cout << " ='correction applied' or 'correction failed'" << std::endl;
127 }
128 
129 
130 
int Int_t
@ kIDCode5
@ kIDCode0
KVMultiDetArray * gMultiDetArray
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
#define e(i)
bool Bool_t
#define N
virtual Bool_t IsType(const Char_t *typ) const
Definition: KVBase.h:178
Patch for correcting bad id-code & calibration for particles stopping in CsI member of etalon modules...
virtual void ApplyToEvent(KVEvent *e)
Just used to set pointer to current event.
virtual Bool_t IsRequired(TString dataset, TString datatype, Int_t runnumber, TString dataseries, Int_t datareleasenumber, const TList *streamerinfolist)
KVINDRAReconEvent * fEvent
pointer to current event
Base class container for multi-particle events.
Definition: KVEvent.h:176
Event reconstructed from energy losses in INDRA multidetector.
Nuclei reconstructed from data measured in the INDRA array.
Full result of one attempted particle identification.
Bool_t IDattempted
=kTRUE if identification was attempted
Bool_t IDOK
general quality of identification, =kTRUE if acceptable identification made
Int_t IDcode
a general identification code for this type of identification
virtual void AcceptParticleForAnalysis(KVReconstructedNucleus *) const
Description of properties and kinematics of atomic nuclei.
Definition: KVNucleus.h:125
virtual void Warning(const char *method, const char *msgfmt,...) const
RooCmdArg ClassName(const char *name)
const Int_t n
gr SetName("gr")
const char * Class