CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
TofShower Class Reference

#include <TofShower.h>

Public Member Functions

 TofShower ()
 
 ~TofShower ()
 
vector< IdentifiergetNeighbors (const Identifier &id)
 
vector< IdentifiergetNextNeighbors (const Identifier &id)
 
vector< IdentifiergetMRPC_neighbours (const Identifier &id)
 
int get_mrpc_partid_neighbour (string which, int stripid, int layer)
 
int get_mrpc_stripid_neighbour (string which, int stripid, int layer)
 
void energyCalib (vector< TofData * > &tofDataVec, RecTofTrackCol *recTofTrackCol)
 
void findSeed (vector< TofData * > &tofDataVec)
 
void findShower (vector< TofData * > &tofDataVec, RecTofTrackCol *recTofTrackCol, double)
 
void BookNtuple (NTuple::Tuple *&tuple, NTuple::Tuple *&tuple1, NTuple::Tuple *&tuple2)
 
void readCalibPar ()
 
double ecalib (const int nsci) const
 
void setEcalib (const int nsci, const double ecalib)
 
double calib (const int n, const int m) const
 
void setCalib (const int n, const int m, const double ecalib)
 
double calibConst () const
 
void setCalibConst (const double cal)
 
bool isData () const
 
void setIsData (const bool isData)
 
 TofShower ()
 
 ~TofShower ()
 
vector< IdentifiergetNeighbors (const Identifier &id)
 
vector< IdentifiergetNextNeighbors (const Identifier &id)
 
vector< IdentifiergetMRPC_neighbours (const Identifier &id)
 
int get_mrpc_partid_neighbour (string which, int stripid, int layer)
 
int get_mrpc_stripid_neighbour (string which, int stripid, int layer)
 
void energyCalib (vector< TofData * > &tofDataVec, RecTofTrackCol *recTofTrackCol)
 
void findSeed (vector< TofData * > &tofDataVec)
 
void findShower (vector< TofData * > &tofDataVec, RecTofTrackCol *recTofTrackCol, double)
 
void BookNtuple (NTuple::Tuple *&tuple, NTuple::Tuple *&tuple1, NTuple::Tuple *&tuple2)
 
void readCalibPar ()
 
double ecalib (const int nsci) const
 
void setEcalib (const int nsci, const double ecalib)
 
double calib (const int n, const int m) const
 
void setCalib (const int n, const int m, const double ecalib)
 
double calibConst () const
 
void setCalibConst (const double cal)
 
bool isData () const
 
void setIsData (const bool isData)
 

Detailed Description

Constructor & Destructor Documentation

◆ TofShower() [1/2]

TofShower::TofShower ( )

Definition at line 28 of file TofShower.cxx.

28 :m_output(false),m_isData(true) // m_output wird auf false und m_isData auf true gesetzt
29{
30 IJobOptionsSvc* jobSvc;
31 Gaudi::svcLocator()->service("JobOptionsSvc", jobSvc);
32 jobSvc->setMyProperties("TofShower", &m_propMgr);
33
34}

◆ ~TofShower() [1/2]

TofShower::~TofShower ( )
inline

◆ TofShower() [2/2]

TofShower::TofShower ( )

◆ ~TofShower() [2/2]

TofShower::~TofShower ( )
inline

Member Function Documentation

◆ BookNtuple() [1/2]

void TofShower::BookNtuple ( NTuple::Tuple *&  tuple,
NTuple::Tuple *&  tuple1,
NTuple::Tuple *&  tuple2 
)

Definition at line 36 of file TofShower.cxx.

37{
38 m_output = true;
39 m_tuple = tuple;
40 if(!m_tuple) {
41 std::cerr << "Invalid ntuple in TofEnergyRec!" << std::endl;
42 } else {
43 m_tuple->addItem ("part", m_part);
44 m_tuple->addItem ("layer", m_layer);
45 m_tuple->addItem ("im", m_im);
46 m_tuple->addItem ("end", m_end);
47 m_tuple->addItem ("zpos", m_zpos);
48 m_tuple->addItem ("adc1", m_adc1);
49 m_tuple->addItem ("adc2", m_adc2);
50 m_tuple->addItem ("tdc1", m_tdc1);
51 m_tuple->addItem ("tdc2", m_tdc2);
52 m_tuple->addItem ("energy", m_energy);
53 }
54
55 m_tuple1 = tuple1;
56 if(!m_tuple1) {
57 std::cerr << "Invalid ntuple1 in TofEnergyRec!" << std::endl;
58 } else {
59 m_tuple1->addItem ("part", m_shower_part);
60 m_tuple1->addItem ("layer", m_shower_layer);
61 m_tuple1->addItem ("im", m_shower_im);
62 m_tuple1->addItem ("zpos", m_shower_zpos);
63 m_tuple1->addItem ("energy", m_shower_energy);
64 }
65
66 m_tuple2 = tuple2;
67 if(!m_tuple2) {
68 std::cerr << "Invalid ntuple2 in TofEnergyRec!" << std::endl;
69 } else {
70 m_tuple2->addItem ("dist", m_seed_dist);
71 }
72}

Referenced by TofEnergyRec::initialize().

◆ BookNtuple() [2/2]

void TofShower::BookNtuple ( NTuple::Tuple *&  tuple,
NTuple::Tuple *&  tuple1,
NTuple::Tuple *&  tuple2 
)

◆ calib() [1/2]

double TofShower::calib ( const int  n,
const int  m 
) const

Definition at line 1002 of file TofShower.cxx.

1003{
1004 if(n<176&&m<4) {
1005 return m_calib[n][m];
1006 } else {
1007 return 0;
1008 }
1009}
const Int_t n

◆ calib() [2/2]

double TofShower::calib ( const int  n,
const int  m 
) const

◆ calibConst() [1/2]

double TofShower::calibConst ( ) const
inline

Definition at line 55 of file InstallArea/include/TofEnergyRec/TofEnergyRec/TofShower.h.

55{ return m_calibConst; }

◆ calibConst() [2/2]

double TofShower::calibConst ( ) const
inline

Definition at line 55 of file Reconstruction/TofEnergyRec/TofEnergyRec-00-00-08/TofEnergyRec/TofShower.h.

55{ return m_calibConst; }

◆ ecalib() [1/2]

double TofShower::ecalib ( const int  nsci) const

Definition at line 986 of file TofShower.cxx.

987{
988 if(nsci<176) {
989 return m_ecalib[nsci];
990 } else {
991 return 0;
992 }
993}

Referenced by setCalib(), and setEcalib().

◆ ecalib() [2/2]

double TofShower::ecalib ( const int  nsci) const

◆ energyCalib() [1/2]

void TofShower::energyCalib ( vector< TofData * > &  tofDataVec,
RecTofTrackCol recTofTrackCol 
)

◆ energyCalib() [2/2]

void TofShower::energyCalib ( vector< TofData * > &  tofDataVec,
RecTofTrackCol recTofTrackCol 
)

Definition at line 74 of file TofShower.cxx.

75{
76 //Get TOF Calibtration Service
77 ISvcLocator* svcLocator = Gaudi::svcLocator();
79 StatusCode sc = svcLocator->service("TofCaliSvc", tofCaliSvc);
80 if (sc != StatusCode::SUCCESS) {
81 cout << "TofEnergyRec Get Calibration Service Failed !! " << endl;
82 }
83
85 sc = svcLocator->service("TofQCorrSvc", tofQCorrSvc);
86 if (sc != StatusCode::SUCCESS) {
87 cout << "TofEnergyRec Get QCorr Service Failed !! " << endl;
88 }
89
91 sc = svcLocator->service("TofQElecSvc", tofQElecSvc);
92 if (sc != StatusCode::SUCCESS) {
93 cout << "TofEnergyRec Get QElec Service Failed !! " << endl;
94 }
95
96 vector<TofData*>::iterator it;
97 for(it=tofDataVec.begin();
98 it!=tofDataVec.end();
99 it++) {
100
101 Identifier id((*it)->identify());
102 int barrel_ec = TofID::barrel_ec(id);
103 int layer = TofID::layer(id);
104 int im = TofID::phi_module(id);
105 int end = TofID::end(id);
106 bool is_mrpc = TofID::is_mymrpc(id);
107
108
109 if(m_output) {
110 m_part = barrel_ec;
111 m_layer = layer;
112 m_im = im;
113 m_end = end;
114 }
115
116 if((*it)->barrel()) {
117 TofData* bTofData = (*it);
118 bTofData->setZpos(99.);
119 bTofData->setEnergy(0.);
120 if(bTofData->tdc1()<=0||bTofData->tdc1()>8000||bTofData->tdc2()<=0||bTofData->tdc2()>8000) continue;
121
122 double adc1,adc2,tdc1,tdc2;
123 tdc1 = bTofData->tdc1();
124 tdc2 = bTofData->tdc2();
125 adc1 = bTofData->adc1();
126 adc2 = bTofData->adc2();
127
128 //from data CalibSvc
129 double zpos = tofCaliSvc->ZTDC( tdc1, tdc2, bTofData->tofId() );
130 if(fabs(zpos)>115) continue;
131 double tofq = tofCaliSvc->BPh( adc1, adc2, zpos, bTofData->tofId());
132 if(tofq<100||tofq>10000) continue;
133 //double energy = q*0.0036;
134 double energy = tofq*m_calibConst; //new calibration result in 2009.9.27
135 //cout<< "TofShower Barrel energy " << energy << endl;
136 zpos /= 100.; //cm->m
137
138 bTofData->setZpos(zpos);
139 bTofData->setEnergy(energy);
140
141 if(m_output) {
142 m_part = barrel_ec;
143 m_layer = layer;
144 m_im = im;
145 m_end = end;
146 m_adc1 = bTofData->adc1();
147 m_adc2 = bTofData->adc2();
148 m_tdc1 = bTofData->tdc1();
149 m_tdc2 = bTofData->tdc2();
150 m_zpos = zpos;
151 m_energy = energy;
152 m_tuple->write();
153 }
154
155 } else {
156
157 if(!is_mrpc)
158 {
159 //cout<<"endcap"<<endl;
160 //ETofData* eTofData = dynamic_cast<ETofData*>(*it);
161 //TofData* bTofData = (*it);
162 //double energy = 2*eTofData->adcChannel()/140;
163 //eTofData->setEnergy(energy);
164 }
165 else if(is_mrpc)
166 {
167
168 TofData* eTofData = (*it);
169 double charge_ns = eTofData->adc(); // time over threshold in ns
170
171 //The next step is to determine the energy deposit in the module. We have three different cases: Neutral tracks, Charged tracks with neighbour, charged track without neighbour
172 bool neutral =true;
173 bool neighborhood = false; //Are more than two cells fired?
174
175 int partId_all = barrel_ec;
176 int module_all = im/25;
177 int strip_all = im%25;
178
179 int partId_charged =-9999;
180 int module_charged =-9999;
181 int strip_charged =-9999;
182
183
184
185
186
187 RecTofTrackCol::iterator rec_charged;
188
189
190 for( rec_charged = recTofTrackCol->begin(); rec_charged != recTofTrackCol->end();rec_charged++)
191 {
192
193
194
195
196
197 TofHitStatus *status = new TofHitStatus;
198 status->setStatus((*rec_charged)->status());
199 if((status->is_barrel())) continue; //Consider only endcap tracks
200 if((*rec_charged)->tofID()<=125) continue;
201
202 if(status->is_east())
203 {
204 if((*rec_charged)->tofID()>=600) {partId_charged=3; module_charged = ((*rec_charged)->tofID()-574)/25; strip_charged =((*rec_charged)->tofID()-574)%25; }
205 else {partId_charged=4; module_charged = ((*rec_charged)->tofID()-100)/25; strip_charged =((*rec_charged)->tofID()-100)%25; }
206 }
207 else
208 {
209 if((*rec_charged)->tofID()>=600) {partId_charged=6; module_charged = ((*rec_charged)->tofID()-574)/25; strip_charged =((*rec_charged)->tofID()-574)%25; }
210 else {partId_charged=5;module_charged = ((*rec_charged)->tofID()-100)/25; strip_charged =((*rec_charged)->tofID()-100)%25;}
211 }
212
213 delete status;
214
215
216 //Determine wether a track is neutral or not:
217 if( (partId_all==3 || partId_all==4) && (partId_charged==3 || partId_charged==4 ) )
218 {
219 if( partId_all==partId_charged && module_charged == module_all && abs(strip_charged-strip_all)<3) neutral =false;
220 if( partId_all==partId_charged && module_charged == module_all)
221 {
222 if(strip_all%2==0 && strip_charged%2!=0 && strip_charged<strip_all && abs(strip_charged-strip_all)<4) neutral =false;
223 if(strip_all%2!=0 && strip_charged%2==0 && strip_charged>strip_all && abs(strip_charged-strip_all)<4) neutral =false;
224 }
225
226
227 if( partId_all!=partId_charged && abs(module_charged-module_all)<2)
228 {
229 if(strip_all%2==0 && strip_charged%2!=0 && abs(strip_charged-strip_all)<3 ) neutral =false;
230 if(strip_all%2==0 && strip_charged%2!=0 && strip_charged<strip_all && abs(strip_charged-strip_all)<4) neutral =false;
231
232 if(strip_all%2!=0 && strip_charged%2==0 && abs(strip_charged-strip_all)<3 ) neutral =false;
233 if(strip_all%2!=0 && strip_charged%2==0 && strip_charged>strip_all && abs(strip_charged-strip_all)<4) neutral =false;
234 }
235
236 }
237 else if ( (partId_all==5 || partId_all==6) && (partId_charged==5 || partId_charged==6 ) )
238 {
239 if( partId_all==partId_charged && module_charged ==module_all && abs(strip_charged-strip_all)<3) neutral =false;
240
241 if( partId_all==partId_charged && module_charged == module_all)
242 {
243 if(strip_all%2==0 && strip_charged%2!=0 && strip_charged<strip_all && abs(strip_charged-strip_all)<4) neutral =false;
244 if(strip_all%2!=0 && strip_charged%2==0 && strip_charged>strip_all && abs(strip_charged-strip_all)<4) neutral =false;
245 }
246
247
248 if( partId_all!=partId_charged && abs(module_charged-module_all)<2)
249 {
250 if(strip_all%2==0 && strip_charged%2!=0 && abs(strip_charged-strip_all)<3 ) neutral =false;
251 if(strip_all%2==0 && strip_charged%2!=0 && strip_charged<strip_all && abs(strip_charged-strip_all)<4) neutral =false;
252
253 if(strip_all%2!=0 && strip_charged%2==0 && abs(strip_charged-strip_all)<3 ) neutral =false;
254 if(strip_all%2!=0 && strip_charged%2==0 && strip_charged>strip_all && abs(strip_charged-strip_all)<4) neutral =false;
255 }
256 }
257
258 }//Close for rec charegd Track
259
260 //Yet we do know wether the track is neutral or not
261
262 //Next step: Determine wether the track has neighborhood (Have two strips in a neighborhood fired?)
263 vector<TofData*>::iterator it_temp;
264 for(it_temp=tofDataVec.begin();it_temp!=tofDataVec.end();it_temp++)
265 {
266
267 Identifier id_temp((*it_temp)->identify());
268 int partId_temp = TofID::barrel_ec(id_temp);
269 int im_temp = TofID::phi_module(id_temp);
270 int module_temp = im_temp/25;
271 int strip_temp = im_temp%25;
272 bool is_mrpc_temp = TofID::is_mymrpc(id_temp);
273
274 if( partId_temp==1 ) continue;
275 if(!is_mrpc_temp) continue;
276
277 if( (partId_all==3 || partId_all==4) && (partId_temp==3 || partId_temp==4 ) )
278 {
279 if( partId_all==partId_temp && module_temp == module_all && abs(strip_temp-strip_all)!=0 && abs(strip_temp-strip_all)<3) neighborhood =true;
280 if( partId_all==partId_temp && module_temp == module_all)
281 {
282 if(strip_all%2==0 && strip_temp%2!=0 && strip_temp<strip_all && abs(strip_temp-strip_all)<4 && abs(strip_temp-strip_all)!=0) neighborhood =true;
283 if(strip_all%2!=0 && strip_temp%2==0 && strip_temp>strip_all && abs(strip_temp-strip_all)<4 && abs(strip_temp-strip_all)!=0) neighborhood =true;
284 }
285
286 if( partId_all!=partId_temp && abs(module_temp-module_all)<2)
287 {
288 if(strip_all%2==0 && strip_temp%2!=0 && abs(strip_temp-strip_all)<3 ) neighborhood =true;
289 if(strip_all%2==0 && strip_temp%2!=0 && strip_temp<strip_all && abs(strip_temp-strip_all)<4) neighborhood =true;
290
291 if(strip_all%2!=0 && strip_temp%2==0 && abs(strip_temp-strip_all)<3 ) neighborhood =true;
292 if(strip_all%2!=0 && strip_temp%2==0 && strip_temp>strip_all && abs(strip_temp-strip_all)<4) neighborhood =true;
293 }
294
295 }//close if partid 3 & 4
296 else if( (partId_all==5 || partId_all==6) && (partId_temp==5 || partId_temp==6 ) )
297 {
298 if( partId_all==partId_temp && module_temp == module_all && abs(strip_temp-strip_all)!=0 && abs(strip_temp-strip_all)<3) neighborhood =true;
299 if( partId_all==partId_temp && module_temp == module_all)
300 {
301 if(strip_all%2==0 && strip_temp%2!=0 && strip_temp<strip_all && abs(strip_temp-strip_all)<4 && abs(strip_temp-strip_all)!=0) neighborhood =true;
302 if(strip_all%2!=0 && strip_temp%2==0 && strip_temp>strip_all && abs(strip_temp-strip_all)<4 && abs(strip_temp-strip_all)!=0) neighborhood =true;
303 }
304
305 if( partId_all!=partId_temp && abs(module_temp-module_all)<2)
306 {
307 if(strip_all%2==0 && strip_temp%2!=0 && abs(strip_temp-strip_all)<3 ) neighborhood =true;
308 if(strip_all%2==0 && strip_temp%2!=0 && strip_temp<strip_all && abs(strip_temp-strip_all)<4) neighborhood =true;
309
310 if(strip_all%2!=0 && strip_temp%2==0 && abs(strip_temp-strip_all)<3 ) neighborhood =true;
311 if(strip_all%2!=0 && strip_temp%2==0 && strip_temp>strip_all && abs(strip_temp-strip_all)<4) neighborhood =true;
312 }
313
314 }//close if partid 5 & 6
315
316 }
317
318
319 double energy =0; // in MeV
320
321 energy = mrpcCaliSvc->GetEnergyCalibration(charge_ns,neutral,neighborhood);
322 eTofData->setEnergy(energy);//set the energy loss in MeV
323
324
325
326 }//close if(is_mrpc)
327
328 }//close else (endcap)
329 }
330}
double abs(const EvtComplex &c)
Definition: EvtComplex.hh:212
************Class m_ypar INTEGER m_KeyWgt INTEGER m_nphot INTEGER m_KeyGPS INTEGER m_IsBeamPolarized INTEGER m_EvtGenInterface DOUBLE PRECISION m_Emin DOUBLE PRECISION m_sphot DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_q2 DOUBLE PRECISION m_PolBeam2 DOUBLE PRECISION m_xErrPb *COMMON c_KK2f $ !CMS energy average $ !Spin Polarization vector first beam $ !Spin Polarization vector second beam $ !Beam energy spread[GeV] $ !minimum hadronization energy[GeV] $ !input READ never touch them !$ !debug facility $ !maximum weight $ !inverse alfaQED $ !minimum real photon energy
Definition: KK2f.h:50
ITofQElecSvc * tofQElecSvc
ITofQCorrSvc * tofQCorrSvc
ITofCaliSvc * tofCaliSvc
virtual const double BPh(double ADC1, double ADC2, double zHit, unsigned int id)=0
virtual const double ZTDC(double tleft, double tright, unsigned id)=0
double GetEnergyCalibration(double, bool, bool)
int tofId()
Definition: TofData.cxx:494
double adc2()
Definition: TofData.cxx:580
double adc()
Definition: TofData.cxx:598
double tdc2()
Definition: TofData.cxx:589
double tdc1()
Definition: TofData.cxx:571
double adc1()
Definition: TofData.cxx:562
void setStatus(unsigned int status)
static int end(const Identifier &id)
static int phi_module(const Identifier &id)
static int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0)
static bool is_mymrpc(const Identifier &id)
static int layer(const Identifier &id)

◆ findSeed() [1/2]

void TofShower::findSeed ( vector< TofData * > &  tofDataVec)

◆ findSeed() [2/2]

void TofShower::findSeed ( vector< TofData * > &  tofDataVec)

Definition at line 547 of file TofShower.cxx.

548{
549 bool max=false;
550 m_seedVec.clear();
551
552 vector<TofData*>::iterator it;
553 for(it=tofDataVec.begin();
554 it!=tofDataVec.end();
555 it++) {
556 if((*it)->barrel()) { //barrel
557 TofData* bTofData = (*it);
558
559
560
561 //cout << "Identifier(bTofData->identify()) " << Identifier(bTofData->identify()) << endl;
562 //std::cout << "TofShower bTofData->energy() = " << bTofData->energy() << std::endl;
563 if(bTofData->energy()<5.) continue; //seed energy cut = 6MeV
564
565 max=true;
566 vector<Identifier> NeighborVec=getNextNeighbors(Identifier(bTofData->identify()));
567
568 //const Identifier & help = Identifier(bTofData->identify());
569 //cout << "TofShower::findSeed Barrel Track base "<<TofID::layer(help) << " " << TofID::phi_module(help) << endl;
570
571 vector<Identifier>::iterator iNeigh;
572 for(iNeigh=NeighborVec.begin();
573 iNeigh!=NeighborVec.end();
574 iNeigh++) {
575
576 //const Identifier & help2 = Identifier(*iNeigh);
577 //cout << "TofShower::findSeed Barrel Track neigh "<<TofID::layer(help2) << " " << TofID::phi_module(help2) << endl;
578
579 vector<TofData*>::iterator it2;
580 for(it2=tofDataVec.begin();
581 it2!=tofDataVec.end();
582 it2++) {
583 if((*it2)->identify()==*iNeigh) {
584 TofData* bTofData2 = (*it2);
585 if(bTofData2->energy()>bTofData->energy()) {
586 max=false;
587 }
588 break;
589 }
590 }
591
592 }
593 }
594 else { //endcap
595
596 //cout << "TofShower::findSeed Endcap Track" << endl;
597 TofData* eTofData = (*it);
598
599 Identifier id((*it)->identify());
600 bool is_mrpc = TofID::is_mymrpc(id);
601
602
603 if(!is_mrpc)
604 {
605 if(eTofData->energy()<5.) continue; //seed energy cut = 5MeV
606 max=true;
607 vector<Identifier> NeighborVec=getNextNeighbors(Identifier(eTofData->identify()));
608 vector<Identifier>::iterator iNeigh;
609 for(iNeigh=NeighborVec.begin(); iNeigh!=NeighborVec.end(); iNeigh++)
610 {
611
612 vector<TofData*>::iterator it2;
613 for(it2=tofDataVec.begin(); it2!=tofDataVec.end(); it2++)
614 {
615 if((*it2)->identify()==*iNeigh) {
616 TofData* eTofData2 = (*it2);
617 if(eTofData2->energy()>eTofData->energy()) {
618 max=false;
619 }
620 break;
621 }
622 }//close for
623 }//Close for
624 }//close if(!is_mrpc)
625 else if(is_mrpc)
626 {
627
628 //cout << "TofShower::findSeed MRPC Track "<< Identifier(eTofData->identify()) << endl;
629 if(eTofData->energy()<2.) continue; //Seed energy cut = 2 MeV
630 max=true;
631
632 vector<Identifier> NeighborVec=getMRPC_neighbours(Identifier(eTofData->identify()));
633
634 //cout << "TofShower::findSeed getMRPC_neighbours OK" << endl;
635 vector<Identifier>::iterator iNeigh;
636
637 for(iNeigh=NeighborVec.begin(); iNeigh!=NeighborVec.end(); iNeigh++)
638 {
639 //cout << "TofShower::findSeed Phimodule MRPC " << TofID::phi_module(*iNeigh) <<endl;
640 vector<TofData*>::iterator it2;
641 for(it2=tofDataVec.begin(); it2!=tofDataVec.end(); it2++)
642 {
643 if((*it2)->identify()==*iNeigh) {
644 TofData* eTofData2 = (*it2);
645 if(eTofData2->energy()>eTofData->energy()) {
646 max=false;
647 }
648 break;
649 }
650 }//close for
651 }//Close for
652 //cout << "TofShower::findSeed Both forloops done" << endl;
653
654 }//Close else if(is_mrpc)
655
656 } //close else endcap
657
658
659 if(max) {
660 m_seedVec.push_back(Identifier((*it)->identify()));
661 }
662
663 }//close loop over tofdata
664}//close find seed
vector< Identifier > getMRPC_neighbours(const Identifier &id)
Definition: TofShower.cxx:469
vector< Identifier > getNextNeighbors(const Identifier &id)
Definition: TofShower.cxx:412

◆ findShower() [1/2]

void TofShower::findShower ( vector< TofData * > &  tofDataVec,
RecTofTrackCol recTofTrackCol,
double   
)

Referenced by TofEnergyRec::execute().

◆ findShower() [2/2]

void TofShower::findShower ( vector< TofData * > &  tofDataVec,
RecTofTrackCol recTofTrackCol,
double   
)

◆ get_mrpc_partid_neighbour() [1/2]

int TofShower::get_mrpc_partid_neighbour ( string  which,
int  stripid,
int  layer 
)

Definition at line 1029 of file TofShower.cxx.

1030{
1031
1033
1034 int returnvalue=0;
1035
1036 if(which=="l")
1037 {
1038 if(strip%2==0) returnvalue = layer;
1039 else
1040 {
1041 if(layer==3) returnvalue = 4;
1042 if(layer==4) returnvalue = 3;
1043 if(layer==5) returnvalue = 6;
1044 if(layer==6) returnvalue = 5;
1045 }
1046 }
1047
1048 if(which=="r")
1049 {
1050 if(strip%2!=0) returnvalue = layer;
1051 else
1052 {
1053 if(layer==3) returnvalue = 4;
1054 if(layer==4) returnvalue = 3;
1055 if(layer==5) returnvalue = 6;
1056 if(layer==6) returnvalue = 5;
1057 }
1058 }
1059
1060 if(which=="u")returnvalue = layer;
1061 if(which=="b")returnvalue = layer;
1062
1063 return returnvalue;
1064
1065}
static G4int Get_stripnumber_from_unique_identifier(G4int unique_identifier_f)

Referenced by getMRPC_neighbours().

◆ get_mrpc_partid_neighbour() [2/2]

int TofShower::get_mrpc_partid_neighbour ( string  which,
int  stripid,
int  layer 
)

◆ get_mrpc_stripid_neighbour() [1/2]

int TofShower::get_mrpc_stripid_neighbour ( string  which,
int  stripid,
int  layer 
)

Definition at line 1070 of file TofShower.cxx.

1071{
1074
1075 int neighbourstrip=0;
1076 int neighbourmodule=0;
1077
1078 int returnvalue=0;
1079
1080 if(strip==0) return 0; //Falls vorher schon strip 1,2 oder 23,24 gibt die Funtion 0 zurück, diese vlt. nochmalige Eingabe wird hier abgefangen und wieder eine 0 zureuckgegebn!
1081
1082 if(which=="l")
1083 {
1084 if(strip%2==0) //gerade Stripnummer
1085 {
1086 neighbourstrip=strip-1; //linke Nachbar ist dann immer -1
1087 if(layer==3 || layer== 6)
1088 {neighbourmodule=module;}//Nachbarmodul ist selbes Modul
1089 else
1090 {neighbourmodule=module;}//Nachbarmodul ist selbes Modul
1091 }
1092 else //ungerade stripnummer
1093 {
1094 neighbourstrip=strip+1;
1095
1096 if(layer==3 || layer== 5)
1097 {
1098 neighbourmodule=module; //In diesem Fall sind die Nachbarschaftsmodule immer gleich
1099 }
1100 else
1101 {
1102 neighbourmodule=module+1;
1103 if(neighbourmodule==19){neighbourmodule=1;}
1104 }
1105
1106 }
1107
1108 returnvalue= BesTofDigitizerEcV4::Produce_unique_identifier(neighbourmodule, neighbourstrip);
1109 } //close if which==l
1110
1111 else if(which=="r")
1112 {
1113 if(strip%2==0) //gerade Stripnummer
1114 {
1115 neighbourstrip=strip-1; //rechte Nachbar ist dann immer -1
1116
1117 if(layer==4 || layer== 6)
1118 {neighbourmodule=module;}//In diesem Fall ist das rechte Nachbarmodul immer die gleiche modulnummer
1119 else
1120 {neighbourmodule=module-1;
1121 if(neighbourmodule==0){neighbourmodule=18;}
1122 }
1123 }
1124 else //ungerade stripnummer
1125 {
1126 neighbourstrip=strip+1;
1127 if(layer==3 || layer== 6)
1128 {neighbourmodule=module;}//Nachbarmodul ist selbes Modul
1129 else
1130 {neighbourmodule=module;} //Nachbarmodul ist selbes Modul
1131
1132 }
1133
1134 returnvalue=BesTofDigitizerEcV4::Produce_unique_identifier(neighbourmodule, neighbourstrip);//geaendert: neighbourmodule=module in dieser und unter Funktionen entfernt..
1135 } //close if which==r
1136
1137 else if(which=="u")
1138 {
1139 if(strip==23 || strip==24) {neighbourmodule=0; neighbourstrip=0;}
1140 else
1141 {
1142 neighbourstrip=strip+2;
1143 neighbourmodule=module;
1144 }
1145
1146 returnvalue= BesTofDigitizerEcV4::Produce_unique_identifier(neighbourmodule, neighbourstrip);
1147 } //close if which==u
1148
1149 else if(which=="b")
1150 {
1151 if(strip==1 || strip==2) {neighbourmodule=0; neighbourstrip=0;}
1152 else
1153 {
1154 neighbourstrip=strip-2;
1155 neighbourmodule=module;
1156 }
1157
1158 returnvalue=BesTofDigitizerEcV4::Produce_unique_identifier(neighbourmodule, neighbourstrip);
1159 } //close if which==b
1160
1161
1162 return returnvalue;
1163}
static G4int Produce_unique_identifier(G4int module_mrpc_f, G4int readoutstripnumber_f)
static G4int Get_module_mrpc_from_unique_identifier(G4int unique_identifier_f)

Referenced by getMRPC_neighbours().

◆ get_mrpc_stripid_neighbour() [2/2]

int TofShower::get_mrpc_stripid_neighbour ( string  which,
int  stripid,
int  layer 
)

◆ getMRPC_neighbours() [1/2]

vector< Identifier > TofShower::getMRPC_neighbours ( const Identifier id)

Definition at line 469 of file TofShower.cxx.

470{
471 //This function returns the following neigbours (x=base)
472 // - - -
473 // - - -
474 // - x -
475 // - - -
476 // - - -
477
478
479 vector<Identifier> NeighborVec;
480
481 int partid_it = TofID::barrel_ec(id);
482 int tofid_it = TofID::phi_module(id);
483
484
485 //int module= BesTofDigitizerEcV4::Get_module_mrpc_from_unique_identifier(partid_it);
486
487 int tofid_l = get_mrpc_stripid_neighbour("l",tofid_it,partid_it);
488 int partid_l = get_mrpc_partid_neighbour("l",tofid_it,partid_it);
489 int tofid_r = get_mrpc_stripid_neighbour("r",tofid_it,partid_it);
490 int partid_r = get_mrpc_partid_neighbour("r",tofid_it,partid_it);
491 int tofid_u = get_mrpc_stripid_neighbour("u",tofid_it,partid_it);
492 int partid_u =get_mrpc_partid_neighbour("u",tofid_it,partid_it);
493 int tofid_b = get_mrpc_stripid_neighbour("b",tofid_it,partid_it);
494 int partid_b = get_mrpc_partid_neighbour("b",tofid_it,partid_it);
495
496 int tofid_lu = get_mrpc_stripid_neighbour("u",tofid_l,partid_l);
497 int partid_lu = get_mrpc_partid_neighbour("u",tofid_l,partid_l);
498 int tofid_lb = get_mrpc_stripid_neighbour("b",tofid_l,partid_l);
499 int partid_lb = get_mrpc_partid_neighbour("b",tofid_l,partid_l);
500 int tofid_ru = get_mrpc_stripid_neighbour("u",tofid_r,partid_r);
501 int partid_ru = get_mrpc_partid_neighbour("u",tofid_r,partid_r);
502 int tofid_rb = get_mrpc_stripid_neighbour("b",tofid_r,partid_r);
503 int partid_rb = get_mrpc_partid_neighbour("b",tofid_r,partid_r);
504
505 int tofid_luu = get_mrpc_stripid_neighbour("u",tofid_lu,partid_lu);
506 int partid_luu =get_mrpc_partid_neighbour("u",tofid_lu,partid_lu);
507 int tofid_lbb = get_mrpc_stripid_neighbour("b",tofid_lb,partid_lb);
508 int partid_lbb = get_mrpc_partid_neighbour("b",tofid_lb,partid_lb);
509 int tofid_ruu = get_mrpc_stripid_neighbour("u",tofid_ru,partid_ru);
510 int partid_ruu = get_mrpc_partid_neighbour("u",tofid_ru,partid_ru);
511 int tofid_rbb = get_mrpc_stripid_neighbour("b",tofid_rb,partid_rb);
512 int partid_rbb = get_mrpc_partid_neighbour("b",tofid_rb,partid_rb);
513 int tofid_uu = get_mrpc_stripid_neighbour("u",tofid_u,partid_u);
514 int partid_uu = get_mrpc_partid_neighbour("u",tofid_u,partid_u);
515 int tofid_bb = get_mrpc_stripid_neighbour("b",tofid_b,partid_b);
516 int partid_bb = get_mrpc_partid_neighbour("b",tofid_b,partid_b);
517
518
519
520
521
522
523 //if(tofid_it%25!=0) NeighborVec.push_back(TofID::cell_id_mrpc(partid_it,tofid_it));
524 if(tofid_l%25!=0) NeighborVec.push_back(TofID::cell_id_mrpc(partid_l,tofid_l));
525 if(tofid_r%25!=0) NeighborVec.push_back(TofID::cell_id_mrpc(partid_r,tofid_r));
526 if(tofid_u%25!=0) NeighborVec.push_back(TofID::cell_id_mrpc(partid_u,tofid_u));
527 if(tofid_b%25!=0) NeighborVec.push_back(TofID::cell_id_mrpc(partid_b,tofid_b));
528
529 if(tofid_lu%25!=0) NeighborVec.push_back(TofID::cell_id_mrpc(partid_lu,tofid_lu));
530 if(tofid_lb%25!=0) NeighborVec.push_back(TofID::cell_id_mrpc(partid_lb,tofid_lb));
531 if(tofid_ru%25!=0) NeighborVec.push_back(TofID::cell_id_mrpc(partid_ru,tofid_ru));
532 if(tofid_rb%25!=0) NeighborVec.push_back(TofID::cell_id_mrpc(partid_rb,tofid_rb));
533
534 if(tofid_luu%25!=0) NeighborVec.push_back(TofID::cell_id_mrpc(partid_luu,tofid_luu));
535 if(tofid_lbb%25!=0) NeighborVec.push_back(TofID::cell_id_mrpc(partid_lbb,tofid_lbb));
536 if(tofid_ruu%25!=0) NeighborVec.push_back(TofID::cell_id_mrpc(partid_ruu,tofid_ruu));
537 if(tofid_rbb%25!=0) NeighborVec.push_back(TofID::cell_id_mrpc(partid_rbb,tofid_rbb));
538 if(tofid_uu%25!=0) NeighborVec.push_back(TofID::cell_id_mrpc(partid_uu,tofid_uu));
539 if(tofid_bb%25!=0) NeighborVec.push_back(TofID::cell_id_mrpc(partid_bb,tofid_bb));
540
541
542 return NeighborVec;
543
544}//close getMRPC Neighbours
static Identifier cell_id_mrpc(int partID, int scinNum)
int get_mrpc_stripid_neighbour(string which, int stripid, int layer)
Definition: TofShower.cxx:1070
int get_mrpc_partid_neighbour(string which, int stripid, int layer)
Definition: TofShower.cxx:1029

Referenced by findSeed().

◆ getMRPC_neighbours() [2/2]

vector< Identifier > TofShower::getMRPC_neighbours ( const Identifier id)

◆ getNeighbors() [1/2]

vector< Identifier > TofShower::getNeighbors ( const Identifier id)

Definition at line 332 of file TofShower.cxx.

333{
334 vector<int> NeighborVec;
335 vector<Identifier> NeighborIdVec;
336 NeighborVec.clear();
337 NeighborIdVec.clear();
338
339 int barrel_ec = TofID::barrel_ec(id);
340 int layer = TofID::layer(id);
341 int im = TofID::phi_module(id);
342 int end = TofID::end(id);
343
344 if(barrel_ec==1) { //barrel
345 int num = im+layer*88;
346 if(num<88) { //layer1
347 if(num==0) {
348 NeighborVec.push_back(1);
349 NeighborVec.push_back(87);
350 NeighborVec.push_back(88);
351 NeighborVec.push_back(89);
352 } else if(num==87) {
353 NeighborVec.push_back(0);
354 NeighborVec.push_back(86);
355 NeighborVec.push_back(88);
356 NeighborVec.push_back(175);
357 } else {
358 NeighborVec.push_back(num+1);
359 NeighborVec.push_back(num-1);
360 NeighborVec.push_back(num+88);
361 NeighborVec.push_back(num+88+1);
362 }
363 } else {
364 if(num==88) {
365 NeighborVec.push_back(89);
366 NeighborVec.push_back(175);
367 NeighborVec.push_back(0);
368 NeighborVec.push_back(87);
369 } else if(num==175) {
370 NeighborVec.push_back(88);
371 NeighborVec.push_back(174);
372 NeighborVec.push_back(86);
373 NeighborVec.push_back(87);
374 } else {
375 NeighborVec.push_back(num+1);
376 NeighborVec.push_back(num-1);
377 NeighborVec.push_back(num-88);
378 NeighborVec.push_back(num-88-1);
379 }
380 }
381
382 int size=NeighborVec.size();
383 for(int i=0;i<size;i++) {
384 layer = NeighborVec[i]/88;
385 im = NeighborVec[i]%88;
386 NeighborIdVec.push_back(TofID::cell_id(barrel_ec,layer,im,end));
387 }
388 }
389
390 else { //endcap
391 if(im==0) {
392 NeighborVec.push_back(1);
393 NeighborVec.push_back(47);
394 } else if(im==47) {
395 NeighborVec.push_back(0);
396 NeighborVec.push_back(46);
397 } else {
398 NeighborVec.push_back(im-1);
399 NeighborVec.push_back(im+1);
400 }
401
402 int size=NeighborVec.size();
403 for(int i=0;i<size;i++) {
404 im = NeighborVec[i];
405 NeighborIdVec.push_back(TofID::cell_id(barrel_ec,layer,im,end));
406 }
407 }
408
409 return NeighborIdVec;
410}
static Identifier cell_id(int barrel_ec, int layer, int phi_module, int end)
For a single crystal.
int num[96]
Definition: ranlxd.c:373

Referenced by getNextNeighbors().

◆ getNeighbors() [2/2]

vector< Identifier > TofShower::getNeighbors ( const Identifier id)

◆ getNextNeighbors() [1/2]

vector< Identifier > TofShower::getNextNeighbors ( const Identifier id)

Definition at line 412 of file TofShower.cxx.

413{
414 vector<Identifier> NeighborVec,tmpNeighborVec,tmpNextNeighborVec;
415 vector<Identifier>::iterator ci_NV,ci_tmpNV,ci_tmpNNV;
416 NeighborVec=getNeighbors(id);
417 tmpNeighborVec=getNeighbors(id);
418 bool flag=false; //whether NeighborVec already includes this crystal
419 bool flagNeighbor=false; //whether this crystal belongs to NeighborVec
420
421 //------------------------------------------------------------------
422 for(ci_tmpNV=tmpNeighborVec.begin();
423 ci_tmpNV!=tmpNeighborVec.end();
424 ci_tmpNV++){
425 tmpNextNeighborVec=getNeighbors(*ci_tmpNV);
426 //================================================================
427 for(ci_tmpNNV=tmpNextNeighborVec.begin();
428 ci_tmpNNV!=tmpNextNeighborVec.end();
429 ci_tmpNNV++){
430
431 for(ci_NV=NeighborVec.begin();
432 ci_NV!=NeighborVec.end();
433 ci_NV++){
434 if(*ci_tmpNNV==*ci_NV){ //this crystal is already included
435 flag=true;
436 break;
437 }
438 }
439
440 if(!flag){ //find a new crystal
441 //for(ci_tmpNV1=tmpNeighborVec.begin();
442 // ci_tmpNV1!=tmpNeighborVec.end();
443 // ci_tmpNV1++){
444 // if(*ci_tmpNNV==*ci_tmpNV1){ //this crystal belongs to NeighborVec
445 // flagNeighbor=true;
446 // break;
447 // }
448 //}
449
450 if(*ci_tmpNNV==id)
451 flagNeighbor=true;
452
453 if(!flagNeighbor)
454 NeighborVec.push_back(*ci_tmpNNV);
455 else
456 flagNeighbor=false;
457 }
458 else
459 flag=false;
460 }
461 //================================================================
462 }
463 //------------------------------------------------------------------
464
465 return NeighborVec;
466}
vector< Identifier > getNeighbors(const Identifier &id)
Definition: TofShower.cxx:332

Referenced by findSeed().

◆ getNextNeighbors() [2/2]

vector< Identifier > TofShower::getNextNeighbors ( const Identifier id)

◆ isData() [1/2]

bool TofShower::isData ( ) const
inline

Definition at line 58 of file InstallArea/include/TofEnergyRec/TofEnergyRec/TofShower.h.

58{ return m_isData; }

Referenced by setIsData().

◆ isData() [2/2]

bool TofShower::isData ( ) const
inline

Definition at line 58 of file Reconstruction/TofEnergyRec/TofEnergyRec-00-00-08/TofEnergyRec/TofShower.h.

58{ return m_isData; }

◆ readCalibPar() [1/2]

void TofShower::readCalibPar ( )

Definition at line 963 of file TofShower.cxx.

964{
965 string paraPath = getenv("TOFENERGYRECROOT");
966 paraPath += "/share/peak.dat";
967 ifstream in;
968 in.open(paraPath.c_str());
969 assert(in);
970 for(int i=0;i<176;i++) {
971 in>>m_ecalib[i];
972 }
973 in.close();
974
975 paraPath = getenv("TOFENERGYRECROOT");
976 paraPath += "/share/calib.dat";
977 ifstream in1;
978 in1.open(paraPath.c_str());
979 assert(in1);
980 for(int i=0;i<176;i++) {
981 in1>>m_calib[i][0]>>m_calib[i][1]>>m_calib[i][2]>>m_calib[i][3];
982 }
983 in1.close();
984}

◆ readCalibPar() [2/2]

void TofShower::readCalibPar ( )

◆ setCalib() [1/2]

void TofShower::setCalib ( const int  n,
const int  m,
const double  ecalib 
)

Definition at line 1011 of file TofShower.cxx.

1012{
1013 if(n<176&&m<4) {
1014 m_calib[n][m]=ecalib;
1015 }
1016}
double ecalib(const int nsci) const
Definition: TofShower.cxx:986

◆ setCalib() [2/2]

void TofShower::setCalib ( const int  n,
const int  m,
const double  ecalib 
)

◆ setCalibConst() [1/2]

void TofShower::setCalibConst ( const double  cal)
inline

Definition at line 56 of file InstallArea/include/TofEnergyRec/TofEnergyRec/TofShower.h.

56{ m_calibConst = cal; }
std::string cal
Definition: CalibModel.cxx:41

Referenced by TofEnergyRec::initialize().

◆ setCalibConst() [2/2]

void TofShower::setCalibConst ( const double  cal)
inline

Definition at line 56 of file Reconstruction/TofEnergyRec/TofEnergyRec-00-00-08/TofEnergyRec/TofShower.h.

56{ m_calibConst = cal; }

◆ setEcalib() [1/2]

void TofShower::setEcalib ( const int  nsci,
const double  ecalib 
)

Definition at line 995 of file TofShower.cxx.

996{
997 if(nsci<176) {
998 m_ecalib[nsci]=ecalib;
999 }
1000}

◆ setEcalib() [2/2]

void TofShower::setEcalib ( const int  nsci,
const double  ecalib 
)

◆ setIsData() [1/2]

void TofShower::setIsData ( const bool  isData)
inline

◆ setIsData() [2/2]

void TofShower::setIsData ( const bool  isData)
inline

The documentation for this class was generated from the following files: