113 |
if(!PMT)PMT = new TClonesArray("ToFPMT",12); //ELENA |
if(!PMT)PMT = new TClonesArray("ToFPMT",12); //ELENA |
114 |
if(!ToFTrk)ToFTrk = new TClonesArray("ToFTrkVar",2); //ELENA |
if(!ToFTrk)ToFTrk = new TClonesArray("ToFTrkVar",2); //ELENA |
115 |
}//ELENA |
}//ELENA |
116 |
|
//-------------------------------------- |
117 |
|
// |
118 |
|
// |
119 |
|
//-------------------------------------- |
120 |
|
void ToFLevel2::SetTrackArray(TClonesArray *track){//ELENA |
121 |
|
if(track && strcmp(track->GetClass()->GetName(),"ToFTrkVar")==0){ |
122 |
|
if(ToFTrk)ToFTrk->Clear("C"); |
123 |
|
ToFTrk = track; |
124 |
|
} |
125 |
|
} |
126 |
|
|
127 |
void ToFLevel2::Clear(Option_t *t){ |
void ToFLevel2::Clear(Option_t *t){ |
128 |
// |
// |
161 |
return toftrack; |
return toftrack; |
162 |
} |
} |
163 |
|
|
164 |
|
/** |
165 |
|
* Retrieves the tof track matching the seqno-th tracker stored track. |
166 |
|
* |
167 |
|
*/ |
168 |
|
ToFTrkVar *ToFLevel2::GetToFStoredTrack(int seqno){ |
169 |
|
|
170 |
|
if( ntrk()==0 ){ |
171 |
|
printf("ToFLevel2::GetToFStoredTrack(int) : requested tracker SeqNo %i but no ToFrimeter tracks are stored\n",seqno); |
172 |
|
return NULL; |
173 |
|
}; |
174 |
|
|
175 |
|
ToFTrkVar *c = 0; |
176 |
|
Int_t it_tof=0; |
177 |
|
|
178 |
|
do { |
179 |
|
c = GetToFTrkVar(it_tof); |
180 |
|
it_tof++; |
181 |
|
} while( c && seqno != c->trkseqno && it_tof < ntrk()); |
182 |
|
|
183 |
|
if(!c || seqno != c->trkseqno){ |
184 |
|
c = 0; |
185 |
|
if(seqno!=-1 ) printf("ToFLevel2::GetToFStoredTrack(int) : requested tracker SeqNo %i does not match ToFrimeter stored tracks\n",seqno); |
186 |
|
}; |
187 |
|
return c; |
188 |
|
|
189 |
|
} |
190 |
|
|
191 |
|
|
192 |
ToFPMT *ToFLevel2::GetToFPMT(Int_t ihit){ |
ToFPMT *ToFLevel2::GetToFPMT(Int_t ihit){ |
193 |
// |
// |
194 |
if(ihit >= npmt()){ |
if(ihit >= npmt()){ |