10 #include "hcategory.h"
11 #include "hiterator.h"
99 fRawCat = fHitCat = NULL;
100 fRawCatTmp = fHitCatTmp = NULL;
102 fTofSimulation = kFALSE;
161 if (spec && rtdb && ev) {
181 if (!
fStartHitCat) Warning(
"init",
"Start hit level not defined; setting start time to 0");
200 if (
fHitCat->getClass()!=HTofHitSim::Class()) {
201 Error(
"HTofHitfSim::init()",
"Misconfigured output category");
211 Error(
"init()",
"No catTofRawTmp in input! You are in embedding mode!");
221 Error(
"init()",
"Could no build catTofHitTmp !");
231 Error(
"init()",
"Could no create HTofCalPar for sim params, needed for embedding !");
240 Error(
"init",
"TOF setup is not defined");
245 Error(
"init",
"Setup, RuntimeDb or event structure not found");
296 Float_t rad2deg = 180./TMath::Pi();
316 theta = (d>0.) ? (rad2deg * TMath::ACos(r.
getZ() / d)) : 0.;
317 phi = rad2deg * TMath::ATan2( r.
getY(), r.
getX());
318 if (phi < 0.) phi += 360.;
337 Float_t startTime=0.0;
338 Float_t startTimeSmearing=0.0;
347 Float_t twalk,twalk_pos;
354 startTimeSmearing = 0.0;
366 HIterator* iterLocal;
367 HCategory* catHitLocal;
378 Bool_t isRealData = kFALSE;
380 (!sim && !embed)) isRealData = kTRUE;
386 if(sim&&embed) iterLocal=
iterTmp;
396 Float_t startTimeLocal = startTime;
397 if(!isRealData) startTimeLocal = startTimeSmearing;
402 while ( (raw=(
HTofRaw *)iterLocal->Next())!=NULL) {
423 Float_t postemp = axpos;
439 atof -= startTimeLocal;
468 leftA=subCl*slopeAdcL;
469 rightA=subCr*slopeAdcR;
487 twalk_pos=twalk_pos-(cell.
getTimeWalkC2()/(TMath::Sqrt(rightA)));
491 twalk_pos=twalk_pos-(cell.
getTimeWalkC2()/(TMath::Sqrt(0.35)));
493 if(subCl>0 && subCr>0) {
496 depE=(cell.
getEdepK())*(TMath::Sqrt(subCl*subCr));
502 hit->
setCell((Char_t) fLoc[2]);
533 TIterator* hititer=
fHitCatTmp->MakeIterator(
"native");
536 while ( (hittmp=(
HTofHitSim *)hititer->Next())!=NULL)
560 Float_t rTime = rTime1;
561 Float_t lTime = lTime1;
563 if(rTime>rTime2) rTime = rTime2;
564 if(lTime>lTime2) lTime = lTime2;
567 Float_t xpos = cell.
getVGroup() * (rTime - lTime)/2.;
602 Error(
"mergeHitCats()",
"Could not retrieve slot in catTofHit!");
615 if(tot<150) amp = 3.0 * tot;
616 else amp = 128. + 2.14 * tot;
virtual Bool_t addCategory(Cat_t aCat, HCategory *cat, Option_t opt[])=0
void setXYZLab(Float_t x, Float_t y, Float_t z)
HGeomTransform & getTransform()
void setAdcFlag(Int_t af)
HCategory * fHitCatTmp
Pointer to the hits category.
void setEdep(Float_t aedep)
HCategory * buildCategory(Cat_t cat)
HGeomCompositeVolume * getRefVolume()
void fillGeometry(HTofHit *)
overwrite embedding mode from 1 to 2 if true (default : false)
Float_t tot2amp(Float_t tot)
HTofGeomPar * fTofGeometry
HModGeomPar * getModule(const Int_t, const Int_t)
Int_t getEmbeddingDebug()
HCategory * buildMatrixCategory(const Text_t *classname, Float_t fillRate)
void setXpos(Float_t axpos)
HCategory * fRawCatTmp
Raw data category.
HRuntimeDb * getRuntimeDb(void)
HEvent *& getCurrentEvent(void)
void enterFunc(const Text_t *func)
void setZ(const Double_t a)
Float_t getLeftTime(void)
Bool_t addContainer(HParSet *)
ClassImp(HDbColumn) HDbColumn
HTofWalkPar * fTofWalkPar
Int_t getNTrack2(void) const
HTofCalPar * fCalParSim
Calibration parameters.
Int_t getNTrack1(void) const
void setRightAmp(Float_t arAmp)
Float_t getRightTime(void)
void setX(const Double_t a)
HSpectrometer * getSetup(void)
HDetector * getDetector(const Char_t *name)
Int_t getNTrack1(void) const
HGeomVolume * getTarget(const Int_t n)
Float_t getRightAmp(void)
Float_t getResolution(void) const
Float_t getTime(void) const
void setNTrack1(const Int_t n)
HParSet * getContainer(const Text_t *)
void setTheta(Float_t th)
void getTofPos(HTofRaw *tofraw, Float_t &tof, Float_t &pos, Float_t x, Float_t startTMP)
void setY(const Double_t a)
void setNTrack2(const Int_t n)
void setLeftAmp(Float_t alAmp)
void setXposAdc(Float_t axposAdc)
static Bool_t bforceKeepGeant
Int_t getNTrack2(void) const
void leaveFunc(const Text_t *func)
virtual HCategory * getCategory(Cat_t aCat)=0
HGeomTransform & getLabTransform()
HTofCalPar * fCalPar
Category with start hits.
HCategory * fHitCat
Raw tmp data category.
void initParContainer(HSpectrometer *, HRuntimeDb *)
void fillHitCat(Bool_t sim=kFALSE, Bool_t embed=kFALSE)
void mergeHitCats(Bool_t sim, Bool_t emb)
void setDistance(Float_t d)
HTofDigiPar * fDigiPar
Calibration parameters of sim for embedding.
HSpecGeomPar * fSpecGeometry
Container for TOF geometry.
void setTof(Float_t atof)
Float_t getRightCharge(void)
HCategory * fStartHitCat
Pointer to the tmp hits category.
Float_t getLeftCharge(void)
HGeomVolume * getComponent(const Int_t)