| 1 |
|
/** |
| 2 |
|
* \file ToFLevel2.cpp |
| 3 |
|
* \author Gianfranca DeRosa, Wolfgang Menn |
| 4 |
|
*/ |
| 5 |
|
|
| 6 |
#include <TObject.h> |
#include <TObject.h> |
| 7 |
#include <ToFLevel2.h> |
#include <ToFLevel2.h> |
| 8 |
#include <iostream> |
#include <iostream> |
| 93 |
// |
// |
| 94 |
}; |
}; |
| 95 |
|
|
| 96 |
|
void ToFLevel2::Set(){//ELENA |
| 97 |
|
if(!PMT)PMT = new TClonesArray("ToFPMT",12); //ELENA |
| 98 |
|
if(!ToFTrk)ToFTrk = new TClonesArray("ToFTrkVar",2); //ELENA |
| 99 |
|
}//ELENA |
| 100 |
|
|
| 101 |
void ToFLevel2::Clear(){ |
void ToFLevel2::Clear(){ |
| 102 |
// |
// |
| 103 |
if(ToFTrk)ToFTrk->Delete(); //ELENA |
if(ToFTrk)ToFTrk->Delete(); //ELENA |
| 206 |
}; |
}; |
| 207 |
|
|
| 208 |
|
|
| 209 |
|
/** |
| 210 |
|
* Method to get the mean dEdx from a given ToF plane |
| 211 |
|
* @param notrack Track Number |
| 212 |
|
* @param plane Plane index (0,1,2,3,4,5). |
| 213 |
|
*/ |
| 214 |
Float_t ToFLevel2::GetdEdx(Int_t notrack, Int_t plane){ |
Float_t ToFLevel2::GetdEdx(Int_t notrack, Int_t plane){ |
| 215 |
|
|
| 216 |
Float_t dedx = 0.; |
Float_t dedx = 0.; |
| 232 |
// |
// |
| 233 |
pl = GetPlaneIndex(pmt_id); |
pl = GetPlaneIndex(pmt_id); |
| 234 |
// |
// |
| 235 |
if ( pl == ip ){ |
if ( pl == ip ) dedx += (trk->dedx).At(i); |
|
// // --- patch --- |
|
|
// bool ISNULL=false; |
|
|
// for(Int_t im=0; im< this->npmt(); im++){ |
|
|
// if(this->GetToFPMT(im)->pmt_id == pmt_id && this->GetToFPMT(im)->adc == 4095){ |
|
|
// cout << " ToFLevel2::GetdEdx(Int_t,Int_t) --> **warning** ADC(PMT="<<pmt_id<<") = 4095"<<endl; |
|
|
// ISNULL=true; |
|
|
// } |
|
|
// } |
|
|
// // --- patch --- |
|
|
// dedx += (trk->dedx).At(i)*(Int_t)(!ISNULL); |
|
|
dedx += (trk->dedx).At(i); |
|
|
} |
|
| 236 |
// |
// |
| 237 |
}; |
}; |
| 238 |
// |
// |
| 240 |
}; |
}; |
| 241 |
|
|
| 242 |
|
|
| 243 |
|
/** |
| 244 |
|
* Method to fill the ADC_C (dEdx) and TDC matrix (4,12) |
| 245 |
|
* @param notrack Track Number |
| 246 |
|
* @param adc ADC_C matrix with dEdx values |
| 247 |
|
* @param tdc TDC matrix |
| 248 |
|
*/ |
| 249 |
void ToFLevel2::GetMatrix(Int_t notrack, Float_t adc[4][12], Float_t tdc[4][12]){ |
void ToFLevel2::GetMatrix(Int_t notrack, Float_t adc[4][12], Float_t tdc[4][12]){ |
| 250 |
// |
// |
| 251 |
for (Int_t aa=0; aa<4;aa++){ |
for (Int_t aa=0; aa<4;aa++){ |
| 286 |
}; |
}; |
| 287 |
|
|
| 288 |
|
|
| 289 |
|
/** |
| 290 |
|
* Method to get the plane index (0 - 5) for the PMT_ID as input |
| 291 |
|
* @param pmt_id PMT_ID (0 - 47) |
| 292 |
|
*/ |
| 293 |
Int_t ToFLevel2::GetPlaneIndex(Int_t pmt_id){ |
Int_t ToFLevel2::GetPlaneIndex(Int_t pmt_id){ |
| 294 |
TString pmtname = GetPMTName(pmt_id); |
TString pmtname = GetPMTName(pmt_id); |
| 295 |
pmtname.Resize(3); |
pmtname.Resize(3); |
| 302 |
return(-1); |
return(-1); |
| 303 |
}; |
}; |
| 304 |
|
|
| 305 |
|
/** |
| 306 |
|
* Method to get the PMT_ID if the index (4,12) is given |
| 307 |
|
* @param hh Channel |
| 308 |
|
* @param kk HalfBoard |
| 309 |
|
*/ |
| 310 |
Int_t ToFLevel2::GetPMTid(Int_t hh, Int_t kk){ |
Int_t ToFLevel2::GetPMTid(Int_t hh, Int_t kk){ |
| 311 |
// |
// |
| 312 |
short tof[4][24] = { |
short tof[4][24] = { |
| 335 |
return ind; |
return ind; |
| 336 |
}; |
}; |
| 337 |
|
|
| 338 |
|
/** |
| 339 |
|
* Method to get the PMT name (like "S11_1A") if the PMT_ID is given |
| 340 |
|
* @param ind PMT_ID (0 - 47) |
| 341 |
|
*/ |
| 342 |
TString ToFLevel2::GetPMTName(Int_t ind){ |
TString ToFLevel2::GetPMTName(Int_t ind){ |
| 343 |
|
|
| 344 |
TString pmtname = " "; |
TString pmtname = " "; |
| 359 |
return pmtname; |
return pmtname; |
| 360 |
}; |
}; |
| 361 |
|
|
| 362 |
|
/** |
| 363 |
|
* Method to get the PMT index if the PMT ID is given |
| 364 |
|
* @param ind PMT_ID (0 - 47) |
| 365 |
|
* @param hb HalfBoard |
| 366 |
|
* @param ch Channel |
| 367 |
|
*/ |
| 368 |
void ToFLevel2::GetPMTIndex(Int_t ind, Int_t &hb, Int_t &ch){ |
void ToFLevel2::GetPMTIndex(Int_t ind, Int_t &hb, Int_t &ch){ |
| 369 |
// |
// |
| 370 |
short tof[4][24] = { |
short tof[4][24] = { |