14 #include "hcategory.h"
15 #include "hlocation.h"
497 Int_t rangeHi0,Int_t rangeHi1,Int_t rangeHi2,Int_t rangeHi3)
572 for(Int_t i = 0; i < 5; i ++)
577 1500,1500,1500,1500);
583 for(Int_t i = 0; i < 4; i ++)
589 for(Int_t s = 0; s < 6; s ++){
590 for(Int_t m = 0; m < 4; m ++){
591 for(Int_t l = 0; l < 6; l ++){
592 for(Int_t c = 0; c < 220; c ++){
613 Error(
"HMdcDigitizer:init()",
"ZERO POINTER FOR HMDCLAYERGEOMPAR RECIEVED!");
619 Error(
"HMdcDigitizer:init()",
"ZERO POINTER FOR HMDCDIGITPAR RECIEVED!");
625 Error(
"HMdcDigitizer:init()",
"ZERO POINTER FOR HMDCCAL2PARSIM RECIEVED!");
631 Error(
"HMdcDigitizer:init()",
"ZERO POINTER FOR HMDCGEOMSTRUCT RECIEVED!");
639 Error(
"HMdcDigitizer:init()",
"ZERO POINTER FOR HMDCCELLEFF RECIEVED!");
648 Error(
"HMdcDigitizer:init()",
"ZERO POINTER FOR HMDCWIRESTAT RECIEVED!");
657 Error(
"HMdcDigitizer:init()",
"ZERO POINTER FOR HMDCSIZESCELLS RECIEVED!");
666 Error(
"HMdcDigitizer:init()",
"ZERO POINTER FOR HMDCDEDX2 RECIEVED!");
694 distance_time =
new TNtuple(
"cal2sim",
"cal2sim",
"sec:mod:lay:cell:dist:angle:time1:time1Err:time2:time2Err:tof:cutEdge:status:track:eff");
708 Error(
"HMdcDigitizer::init()",
"HGeant MDC input missing");
715 Error(
"HMdcDigitizer::init()",
"HGeant Kine input missing");
738 if (
fCalCat->getClass() != HMdcCal1Sim::Class()) {
739 Error(
"HMdcDigitizer::init()",
"Misconfigured output category");
746 myoutput =
new TFile(
"digitizer.root",
"RECREATE");
758 memset(&
rndmoffsets[0][0][0][0],0,
sizeof(Float_t) * 6 * 4 * 6 * 220);
760 for(Int_t s = 0;s < 6; s ++){
761 for(Int_t m = 0; m < 4; m ++){
762 for(Int_t l = 0; l < 6; l ++){
763 for(Int_t c = 0; c < 220; c ++){
776 for(Int_t m = 0; m < 4; m ++){
782 Bool_t result = kFALSE;
789 for(Int_t s = 0;s < 6; s ++){
790 for(Int_t m = 0; m < 4; m ++){
791 for(Int_t l = 0; l < 6; l ++){
803 for(Int_t s = 0;s < 6; s ++){
804 for(Int_t m = 0; m < 4; m ++){
806 for(Int_t l = 0; l < 6; l ++){
808 layEff.
cmax[s][m][l] = (*fsizescells) [s][m][l].getNCells()-1;
809 layEff.
cmin[s][m][l] = (*fDigitGeomPar)[s][m][l].getCentralWireNr();
813 const HGeomVector&
p1 = *(*fsizescells)[s][m][l][c].getWirePoint(0);
814 const HGeomVector&
p2 = *(*fsizescells)[s][m][l][c].getWirePoint(1);
819 Int_t firstCell,lastCell;
820 Float_t firstCellPath,midCellPath,lastCellPath;
825 firstCellPath,midCellPath,lastCellPath))
829 ncells += lastCell-firstCell;
831 Float_t totalePathInLayer = 0.;
832 for(Int_t cell=firstCell;cell<=lastCell;++cell) {
834 if (cell == firstCell) { cellPath = firstCellPath;}
835 else if (cell == lastCell) { cellPath = lastCellPath; }
836 else { cellPath = midCellPath; }
837 totalePathInLayer += cellPath;
844 const HGeomVector&
p1 = *(*fsizescells)[s][m][l][c].getWirePoint(0);
845 const HGeomVector&
p2 = *(*fsizescells)[s][m][l][c].getWirePoint(1);
850 Int_t firstCell,lastCell;
851 Float_t firstCellPath,midCellPath,lastCellPath;
856 firstCellPath,midCellPath,lastCellPath))
860 ncells += lastCell-firstCell;
862 Float_t totalePathInLayer = 0.;
863 for(Int_t cell=firstCell;cell<=lastCell;++cell) {
865 if (cell == firstCell) { cellPath = firstCellPath;}
866 else if (cell == lastCell) { cellPath = lastCellPath; }
867 else { cellPath = midCellPath; }
868 totalePathInLayer += cellPath;
905 ,
"tdcModeDigi = %i : 1 = two leading edges, 2 = leading and trailing edge",
getTdcMode());
907 ,
"NtupleDigi = %i : 0 = noNtuple, 1 = digitizer.root",(Int_t)
getNTuple());
909 ,
"useTofDigi = %i : 0 = NoTof in cal1, 1 = Tof in cal1 \n",(Int_t)
getTofUse());
911 ,
"useErrorDigi = %i : 0 = NoErr in cal1, 1 = Err in cal1 \n",(Int_t)
getErrorUse());
913 ,
"useWireOffsetDigi = %i : 1 = add wireOffset to drift time, 0 = don't add wireOffsets"
916 ,
"useWireStatDigi = %i : 1 = use wirestat container, 0 = don't use wirestat container"
919 ,
"useWireStatEff = %i : 1 = use eff from wirestat container"
922 ,
"useWireStatOffset = %i : 1 = use offsets from wirestat container"
925 ,
"useTimeCut = %i : 1 = use time cut container, 0 = don't use time cut container"
928 ,
"offsetsOnDigi = %i : 0 = global offsets off, 1 = global offsets on",(Int_t)
getOffsetsUse());
930 ,
"offsetsDigi = %4.1f %4.1f %4.1f %4.1f ns offset per plane (substracted from (drift time + tof))\n"
933 ,
"noiseModeDigi = %i : 1 = override geant by noise, 2 = keep geant cells",
getNoiseMode());
935 ,
"noiseOnDigi = %i : 0 = noise off, 1 = noise on",(Int_t)
getNoiseUse());
937 ,
"noiseLevelDigi = %4.1f%% %4.1f%% %4.1f%% %4.1f%% noise level per plane"
940 ,
"noiseRangeDigi =%5i %5i %5i %5i %5i %5i %5i %5i ns lower/upper limit of noise"
944 ,
"noiseBandWidth = %5.1f ns : width of the t2-t1 noise band",
getNoiseBandWidth());
946 ,
"noiseWhiteWidth = %5.1f ns : width of the t2-t1 white noise region",
getNoiseWhiteWidth());
948 ,
"noiseWhiteRatio = %5.1f : ratio between t2-t1 band/white noise\n",
getNoiseWhiteRatio());
950 ,
"cellEffOnDigi = %i : 0 = cellEff off, 1 = cellEff",(Int_t)
getCellEffUse());
952 ,
"cellEffDigi = %4.1f%% %4.1f%% %4.1f%% %4.1f%% level of cellEff per plane"
955 ,
"fBetaLow = %f : onset scaling point for LayerEff,CellEff,time1Err with dEdx"
958 ,
"scaleTime1Err = %5.4f %5.4f %5.4f %5.4f input scaling for t1 err"
961 ,
"scaleTime1ErrMIPS = %5.4f %5.4f %5.4f %5.4f scaling for t1 err for MIPS"
1028 for(Int_t i=0;i<nKine;i++){
1055 fGeant->
getHit(xcoord, ycoord, tof, ptot);
1061 Bool_t isDelta = kFALSE;
1063 Int_t generator = 0;
1074 Error(
"execute()",
"No primary for trk = %i found!",trkNum);
1084 Float_t t0offset = 0;
1088 Error(
"execute()",
"No primary in delta map for trk = %i found! Should not happen!",trkNum);
1096 fGeant->
setHit(xcoord, ycoord, tof, ptot);
1099 if(isDelta)
continue;
1115 if(
loc[2] < 6)
transform(xcoord,ycoord,theta,phi,tof,trkNum);
1125 setLoopVariables(0,0,0,0);
1133 loc[0] = fCell->getSector();
1134 loc[1] = fCell->getModule();
1135 loc[2] = fCell->getLayer();
1136 loc[3] = fCell->getCell();
1151 if((getNHitsReal() == 2 && getTdcMode() == 1) ||
1152 (getNHitsReal() < 0 && getTdcMode() == 2) )
1154 Warning(
"HMdcDigitizer:execute()",
"HMdcCalibater1 and HMdcDigitizer running in different tdc modes!");
1165 Int_t nHits = fCell->getNumHits();
1166 for(Int_t ihit = 0; ihit < nHits; ihit ++)
1168 fillArrays (ihit,loc[0],loc[1],fCell);
1169 setEfficiencyFlags(ihit,loc[0],loc[1],loc[2]);
1175 if(getEmbeddingMode() == 1 && getTime1Real() != -999)
1177 fillArraysReal(nHits);
1178 if(getTdcMode() == 2) nHits = nHits + 1;
1179 else if(getTdcMode() == 1)nHits = nHits + 2;
1183 if (nHits > 1) select(nHits);
1185 resetListVariables();
1192 if(getStatus(
hit) == 0)
continue;
1193 fillNTuple(loc[0],loc[1],loc[2],loc[3],
hit,
1194 fCell,distance_time);
1200 findFirstValidHit();
1209 fCal->
setAddress(loc[0],loc[1],loc[2],loc[3]);
1213 Warning(
"HMdcDigitizer:execute()",
"CAL1SIM:getSlot(loc) failed!");
1220 if(getTdcMode() == 1 || getTdcMode() == 2)
1222 if(getFirstHit() != -999)
1240 getDTime1(getFirstHit())
1241 + ( ((Int_t)getTofUse() - 1) * getTof(getFirstHit()) )
1242 + ( ((Int_t)getErrorUse() - 1) * getDTime1Err(getFirstHit()) )
1243 - ( ((Int_t)getOffsetsUse()) * getOffset(loc[1]) )
1244 + ( ((Int_t)getWireOffsetUse() - 1) * getWireOffset(getFirstHit()) ) );
1246 fCal->setNTrack1(getTrackN(getFirstHit()));
1247 fCal->setStatus1(getStatus(getFirstHit()));
1248 fCal->setAngle1(getAngle(getFirstHit()));
1249 fCal->setMinDist1(getMinimumDist(getFirstHit()));
1250 fCal->setError1(getDTime1Err(getFirstHit()));
1251 fCal->setTof1(getTof(getFirstHit()));
1252 fCal->setWireOffset1(getWireOffset(getFirstHit()));
1256 fCal->setStatus1(findNonValidHit());
1261 if(getTdcMode() == 2)
1263 if(getFirstHit() != -999)
1267 getDTime2(getFirstHit())
1268 + ( ((Int_t)getTofUse() - 1) * getTof(getFirstHit()) )
1269 + ( ((Int_t)getErrorUse() - 1) * getDTime2Err(getFirstHit()) )
1270 - ( ((Int_t)getOffsetsUse()) * getOffset(loc[1]) )
1271 + ( ((Int_t)getWireOffsetUse() - 1)* getWireOffset(getFirstHit()) ) );
1273 fCal->setNTrack2(getTrackN(getFirstHit()));
1275 fCal->setStatus2(getStatus(getFirstHit()));
1276 fCal->setAngle2(getAngle(getFirstHit()));
1277 fCal->setMinDist2(getMinimumDist(getFirstHit()));
1278 fCal->setError2(getDTime2Err(getFirstHit()));
1279 fCal->setTof2(getTof(getFirstHit()));
1280 fCal->setWireOffset2(getWireOffset(getFirstHit()));
1284 fCal->setStatus2(findNonValidHit());
1290 if (nHits == 1 && getTdcMode() == 1) fCal->setNHits(-1);
1293 if(nHits > 1 && getTdcMode() == 1 && getFirstHit() != -999)
1295 findSecondValidHit();
1297 if (getSecondHit() == -999 )
1304 getDTime1(getSecondHit())
1305 + ( ((Int_t)getTofUse() - 1) * getTof(getSecondHit()) )
1306 + ( ((Int_t)getErrorUse() - 1) * getDTime1Err(getSecondHit()) )
1307 - ( ((Int_t)getOffsetsUse()) * getOffset(loc[1]) )
1308 + ( ((Int_t)getWireOffsetUse() -1) * getWireOffset(getSecondHit()) ) );
1310 fCal->setNTrack2(getTrackN(getSecondHit()));
1312 fCal->setStatus2(getStatus(getSecondHit()));
1313 fCal->setAngle2(getAngle(getSecondHit()));
1314 fCal->setMinDist2(getMinimumDist(getSecondHit()));
1315 fCal->setError2(getDTime1Err(getSecondHit()));
1316 fCal->setTof2(getTof(getSecondHit()));
1317 fCal->setWireOffset2(getWireOffset(getSecondHit()));
1320 else if(nHits > 1 && getTdcMode() == 1)
1322 fCal->setStatus2(findNonValidHit());
1328 fillTrackList(fCal);
1344 setLoopVariables(0,0,0,0);
1347 Int_t sec,mod,lay,cell;
1349 while ((fCal = (
HMdcCal1Sim *)itercal1->Next()) != NULL)
1351 fCal->getAddress(sec,mod,lay,cell);
1352 if(getNoiseMode() == 1 && ( gRandom->Rndm()<getNoiseLevel(mod)) )
1358 fillNoiseToGeantCells(mod,fCal);
1360 fillNoise(firstsec,firstmod,firstlay,firstcell,sec,mod,lay,cell);
1361 setLoopVariables(sec,mod,lay,cell + 1,kTRUE);
1363 fillNoise(firstsec,firstmod,firstlay,firstcell,5,3,5,999);
1372 while ((fCal = (
HMdcCal1Sim *)itercal1->Next()) != NULL)
1374 setTimeCutFlags(fCal);
1422 Bool_t found = kFALSE;
1435 if(!found) gMdc = 0;
1443 gMdc->
getHit(x, y, tof, p);
1448 Warning(
"fillArrays()",
"HGeantMdc object not found, take kine momentum instead!");
1463 if(dedx > dedx_low) dedx = dedx_low;
1464 initFrac *= dedx_low/dedx;
1490 if(TMath::Finite(t2) && t2 > 0){
1497 Error(
"fillArrays()",
"ZERO POINTER for kine object retrieved!");
1522 Float_t def_val = -99;
1598 Warning(
"HMdcDigitizer:fillArraysReal()",
"real hit could not be stored to array,\n because the maximum has been exceeded!");
1635 Float_t valRand = 1;
1639 Error(
"setEfficiencyFlags()",
"tracknumber %i not Found",
getTrackN(ihit));
1640 }
else if (
vLayEff[ind].ct[sec][mod][lay] == 1){
1641 valRand =
vLayEff[ind].eff[sec][mod][lay];
1643 valRand = gRandom->Rndm();
1652 Double_t scale = efflevel/initFrac;
1656 Double_t dedx_mip =
fbetadEdx->Eval(0.95);
1657 Double_t scaleMip = dedx_low/dedx_mip;
1658 eff -= (( scale - 1. )/(scaleMip -1.))*(1.-effScale);
1659 if(eff < 0) eff = 0;
1743 Bool_t result = kTRUE;
1747 (stat > 0)? result = kTRUE : result = kFALSE;
1756 for(Int_t i = 0; i <
NMAXHITS; i ++)
1808 distance_time->Fill(sec,mod,lay,cell,
1823 Float_t time, Float_t time2,
1844 Float_t time1Noise = -999;
1852 Float_t time2Noise = -999;
1872 Int_t dummystat [5] = { 0, 0, 0, 0, 0};
1873 Int_t dummytrack[5] = {-99,-99,-99,-99,-99};
1874 dummystat[0] =statval;
1882 mylist[0] = statval;
1933 if(firstc>(*
geomstruct)[firsts][firstm][firstl])
1944 for(Int_t i = firsts; i < 6; i ++)
1946 for(Int_t j = firstm; j < 4; j ++)
1962 Int_t lastsec, Int_t lastmod, Int_t lastlay, Int_t lastcell)
1973 for (Int_t sec =
firstsec; sec <= lastsec; sec ++)
1975 if(sec > 5)
continue;
1976 for (Int_t mod =
firstmod; mod <= lastmod; mod ++)
1978 if(mod > 3)
continue;
1982 for (Int_t lay =
firstlay; lay <= lastlay; lay ++)
1984 if(lay > 5)
continue;
1987 for (Int_t cell =
firstcell; cell < lastcell; cell ++)
1989 if(cell > (*
geomstruct)[sec][mod][lay])
continue;
2049 for (Int_t cell = firstc; cell < nWires; cell ++)
2114 for(Int_t i = 0; i < 5; i ++)
2152 if(lasthit < NMAXHITS)
2204 Int_t foundTimeCut = 0;
2208 if(
getStatus(hit) == -5 ) foundTimeCut ++;
2219 return foundTimeCut > 0 ? -5 : -3;
2220 }
else {
return -7; }
2230 register Int_t a,b,c;
2241 Float_t mindistlocal;
2242 Bool_t cutEdgelocal;
2243 Float_t fractionlocal;
2244 Float_t wireOffsetlocal;
2246 if(nHits <= NMAXHITS)
2248 for(a = 0; a < nHits - 1; ++ a)
2257 tracklocal =
track[a];
2259 angleLocal =
angle[a];
2266 for(b=a+1;b<nHits;++b)
2276 tracklocal =
track[b];
2278 angleLocal =
angle[b];
2299 track[a] = tracklocal;
2303 angle[a] = angleLocal;
2320 Warning(
"HMdcDigitizer:select(nHits)",
"nHits > 15! Entries >15 skipped! ");
2330 Error(
"HMdcDigitizer::getMdcSetup()",
"Mdc-Detector setup (gHades->getSetup()->getDetector(\"Mdc\")) missing.");
2332 for(Int_t s = 0; s < 6; s ++) {
2333 for(Int_t m = 0; m < 4; m ++) {
2345 Bool_t result=kFALSE;
2346 if(
setup[s][m] == 0) result = kFALSE;
2347 if(
setup[s][m] == 1) result = kTRUE;
2351 Float_t
phi ,Float_t tof ,Int_t trkNum) {
2383 Float_t effPenalty =
effLayerThickness(xcoor,ycoor,theta, phi,loc[0],loc[1],loc[2]);
2389 for (loc[3] = nCmin; loc[3] <= nCmax; loc[3] ++) {
2393 Float_t ctanalpha = tan(theta *
pi) * sin(phi * pi - wOrient);
2396 myalpha = 90. - fabs(atan(ctanalpha) * TMath::RadToDeg());
2398 Float_t sinAlpha = sqrt(1. / (1. + ctanalpha * ctanalpha));
2399 Float_t cosAlpha = sqrt(1. - sinAlpha * sinAlpha);
2401 Float_t per = fabs(yDist * sinAlpha);
2403 Bool_t flagCutEdge = kFALSE;
2404 if(per * sinAlpha > halfPitch) {
2406 flagCutEdge = kTRUE;
2408 }
else if(per * cosAlpha > halfCatDist) {
2410 flagCutEdge = kTRUE;
2418 Float_t x_wire = sclayer.
getXinRotLay(loc[3],xcoor,ycoor);
2428 ,Bool_t flagCutEdge,Float_t wireOffset,Float_t eff,Float_t
theta)
2439 nHit =
hit->getNumHits();
2440 if (nHit < NMAXHITS ) {
2445 hit->setNumHits(nHit + 1);
2446 hit->setMinDist(per,nHit);
2447 hit->setTimeFlight(tof,nHit);
2448 hit->setImpactAngle(myangle,nHit);
2449 hit->setNTrack(trkNum,nHit);
2450 hit->setFlagCutEdge(flagCutEdge,nHit);
2451 hit->setWireOffset(wireOffset,nHit);
2452 hit->setEfficiency(eff,nHit);
2453 hit->setTheta(theta,nHit);
2457 Warning(
"HMdcDigitizer:storeCell()",
"hit could not be stored in HMdcGeantCell ,\n because number of hits exceeded the maximum!");
2471 for(Int_t s = 0;s < 6; s ++){
2472 for(Int_t m = 0; m < 4; m ++){
2473 for(Int_t l = 0; l < 6; l ++){
2474 for(Int_t c = 0; c < 220; c ++){
2481 if(filename.CompareTo(
"") == 0)
2483 Warning(
"HMdcDigitizer:initOffsets()",
"No file name specified, offsets will not be written to file!");
2487 FILE* ascii=fopen(filename,
"w");
2488 for(Int_t s = 0; s < 6; s ++){
2489 for(Int_t m = 0; m < 4; m ++){
2490 for(Int_t l = 0; l < 6; l ++){
2491 for(Int_t c = 0; c <220; c ++){
2492 fprintf(ascii,
"%i %i %i %3i %7.3f \n",s,m,l,c,
rndmoffsets[s][m][l][c]);
2502 FILE* ascii = fopen(filename,
"r");
2505 Warning(
"HMdcDigitizer:initOffsets()",
"Specified file %s does not exist, offsets will be 0.0.!",filename.Data());
2509 cout<<
"HMdcDigitizer:initOffsets() Reading offset table from file "<<filename.Data()<<endl;
2516 if(feof(ascii))
break;
2517 Bool_t res=fgets(line,
sizeof(line), ascii);
2518 if(!res)cout<<
"initOffsets: cannot read next line!"<<endl;
2519 sscanf(line,
"%i %i %i %i %f",&s,&m,&l,&c,&off);
2533 for(UInt_t i = 0; i <
vLayEff.size(); i ++){
2534 if(
vLayEff[i].trackNum == trk)
return i;
2542 if(effmin==0)
return 1;
2543 const Float_t effmax = 1.00;
2551 if(Lmin < 0 || Lmax < 0) {
2553 Error(
"effLayerThickness()",
"Lmin or Lmax not set Lmin = %f , Lmax = %f ! ",Lmin,Lmax);
2560 Double_t x1,y1,z1,x2,y2,z2;
2562 Double_t
theta = th*TMath::DegToRad();
2563 Double_t
phi = ph*TMath::DegToRad();
2564 Double_t sinTh = sin(theta);
2565 Double_t xDir = sinTh*cos(phi);
2566 Double_t yDir = sinTh*sin(phi);
2567 Double_t zDir = sqrt(1.-sinTh*sinTh);
2582 Int_t firstCell,lastCell;
2583 Float_t firstCellPath,midCellPath,lastCellPath;
2587 firstCellPath,midCellPath,lastCellPath))
2591 ncells += lastCell-firstCell;
2593 Float_t totalePathInLayer = 0.;
2595 for(Int_t cell=firstCell;cell<=lastCell;++cell) {
2597 if (cell == firstCell) { cellPath = firstCellPath;}
2598 else if (cell == lastCell) { cellPath = lastCellPath; }
2599 else { cellPath = midCellPath; }
2600 totalePathInLayer += cellPath;
2603 if(totalePathInLayer>Lmax) totalePathInLayer = Lmax;
2604 if(totalePathInLayer<Lmin) totalePathInLayer = Lmin;
2606 Float_t eff = effmin + ( (effmax - effmin) * (totalePathInLayer-Lmin) / (Lmax-Lmin) );
void setNoiseWhiteRatio(Float_t w)
void setDTime2Err(Int_t i, Float_t timeErr)
void fillNTuple(Int_t, Int_t, Int_t, Int_t, Int_t, HMdcGeantCell *, TNtuple *)
Float_t rndmoffsets[6][4][6][220]
scaler for error of time per module type
HMdcGeantCell * fCell
pointer to noise data
void setSignalSpeed(Float_t speed)
static HGeantKine * getPrimary(Int_t track, HLinearCategory *cat=NULL)
Bool_t getWireStatEffUse()
Bool_t initContainer(void)
HCategory * fCalCat
Pointer to sim data category.
static Float_t dTimeErr[NMAXHITS]
drift time2 + tof
static Int_t getEmbeddingRealTrackId()
Float_t getTotalMomentum(void) const
void setTrackList(Int_t i, Int_t track)
Float_t getOffset(Int_t sec, Int_t mod, Int_t lay, Int_t cell)
void setNHitsReal(Int_t i)
void transFrom(Double_t &x, Double_t &y, Double_t &z) const
HIterator * itercell
Iterator over input category.
Float_t getEfficiency(Int_t j) const
void findSecondValidHit()
Bool_t hasPrinted
map delta electron candidates to t1 offsets
void setOffsets(Float_t off0, Float_t off1, Float_t off2, Float_t off3, Int_t on_off=1)
void setScaleTime(Float_t scale)
Float_t getFractionOfmaxCharge(Int_t i)
Float_t t1minDeltaElec
0 - 1 probability to accept a delta electron (yield adjustment)
Float_t getWireOffset(Int_t j) const
void initOffsets(TString filename="")
void setAngle(Int_t i, Float_t a)
Char_t getReadoutSide(void) const
Int_t fEventId
Iterator over cal1 category.
void setTime1(const Float_t t)
static TGraph * energyLossGraph(Int_t id, Double_t hefr=0.6, TString opt="p", Bool_t exchange=kFALSE, Int_t markerstyle=8, Int_t markercolor=2, Float_t markersize=0.7)
Bool_t useNoise
level of randon noise for each module type
Float_t effLayerThickness(Float_t xcoor, Float_t ycoor, Float_t th, Float_t ph, Int_t s, Int_t m, Int_t l)
layer eff object for calulation of eff depending on impact angle
Bool_t useWireStatEff
switch for use/not use wire stat container
void setDeltaElectronMinMomCut(Float_t s0=2., Float_t s1=2., Float_t s2=4.5, Float_t s3=2., Float_t s4=2., Float_t s5=4.5)
Float_t fProbDeltaAccepted
beam ion (au ==109)
void setAddress(const Int_t s, const Int_t m, const Int_t l, const Int_t c)
Float_t fBetaLow
dedx as function of beta for scaling
static Float_t timeOfFlight[NMAXHITS]
track numbers
void setEmbeddingMode(Int_t mode)
void setError1(const Float_t f)
Int_t ionID
switch for use/not use momentum below momMaxDeltaElecCut for primary electrons to identify delta elec...
Bool_t offsetsCreated
switch kTRUE: create offsets,kFALSE: read from file
Bool_t cutTime2(HMdcCal1 *cal)
Float_t time1
setup of Mdc (sec,mod)
Float_t getDTime1(Int_t i)
Float_t getNoiseWhiteRatio()
HMdcLayerGeomPar * fDigitGeomPar
Pointer to HMdcGeantCell hit.
Float_t getTimeFlight(Int_t j) const
void fillTrackList(HMdcCal1Sim *)
void setEffLevel(Float_t eff0, Float_t eff1, Float_t eff2, Float_t eff3, Int_t on_off=1)
Bool_t transform(Float_t, Float_t, Float_t, Float_t, Float_t, Int_t)
Bool_t calcCrossedCells(Double_t x1, Double_t y1, Double_t z1, Double_t x2, Double_t y2, Double_t z2, Float_t &cell1, Float_t &cell2) const
Double_t getWireOrient(Int_t c) const
Float_t getTime1ErrScale(Int_t m)
Int_t getEmbeddingDebug()
void resetListVariables()
void setTime2(const Float_t t)
void setNoiseWhiteWidth(Float_t w)
void getStatusList(Int_t *array)
Float_t getTime2(void) const
void setTof1(const Float_t f)
Bool_t modStatus(Int_t s, Int_t m) const
void setTimeCutFlags(HMdcCal1Sim *cal1)
Float_t getNoiseBandWidth()
void setTof(Int_t i, Float_t tof)
const Cat_t catMdcGeantRaw
static Float_t dTime[NMAXHITS]
ration between large region and band in noise
Double_t getXinRotLay(Int_t c, Double_t xi, Double_t yi) const
void setTrackN(Int_t i, Int_t number)
void setTof2(const Float_t f)
static Float_t angle[NMAXHITS]
tof
void setEfficiencyFlags(Int_t, Int_t, Int_t, Int_t)
Float_t getSigmaOffsets()
Float_t getDTime2(Int_t i)
HRuntimeDb * getRuntimeDb(void)
HMdcDigiLayEff layEff
layer eff random numbers per track
HEvent *& getCurrentEvent(void)
void setMinimumDist(Int_t i, Float_t dist)
Int_t getGeneratorInfo() const
Float_t myalpha
drift time2 error calculated by HMdcCal2ParSim
TGraph p2(xdim, pgrid, respme)
void setNTrack1(const Int_t n)
virtual Int_t getModule(Int_t sector, Int_t mod)
Float_t yDist
Number of current event.
const Cat_t catMdcGeantCell
void setAngle1(const Float_t f)
void setSecondHit(Int_t hit2)
Float_t time2
drift time1 error calculated by HMdcCal2ParSim
void setFirstTime2(Float_t time2)
Int_t noiseRangeLo[4]
temp array for status of noise
Float_t getLayerEfficiencyScale(Int_t s, Int_t m, Int_t l)
static HMdcSizesCells * getObject(void)
Float_t getOffset(Int_t i)
void setNoiseMode(Int_t mode)
void setMinDist1(const Float_t f)
ClassImp(HDbColumn) HDbColumn
HMdcDeDx2 * fdEdX
pointer to hmdcsizescells parameter container
Float_t scaleErrorMIPS[4]
scaler for error of time per module type
HIterator * iterin
pointer to Container for HMdcGeantCell
void setNTuple(Bool_t ntuple)
Float_t getMinDist(Int_t j) const
void fillArrays(Int_t, Int_t, Int_t, HMdcGeantCell *)
HIterator * itercal1
Iterator over cell category.
void setTofUse(Bool_t use)
void setLoopVariables(Int_t, Int_t, Int_t, Int_t, Bool_t check=kFALSE)
HCategory * fGeantCellCat
Location for new object.
Int_t calcEfficiency(Int_t m, Float_t r, Float_t a, Float_t l)
void info(Char_t level, Int_t det, const Char_t *className, const Char_t *text)
HMdcCal1Sim * fCalnoise
pointer to data
Bool_t getWireOffsetUse()
static Int_t track[NMAXHITS]
minimum distance to wire
Bool_t calcCrCellsGeantMdc(Float_t &x, Float_t &y, Float_t theta, Float_t phi, Int_t &c1, Int_t &c2) const
void setSigmaOffsets(Float_t sig)
void setWireStatUse(Bool_t use)
void setDTime2(Int_t i, Float_t time)
void setFirstHit(Int_t hit1)
HMdcSizesCells * fsizescells
pointer to time cut parameter container
Float_t getTime1ErrScaleMIPS(Int_t m)
static Float_t wireOffset[NMAXHITS]
flag for minimum distance point out of cell
Int_t getParentTrack(void) const
HMdcDigitPar * fDigitPar
Digitisation "geom" parameters.
TGraph * fbetadEdx
switch for use/not use offset substraction in output
HLocation loc
HGeantKine input data.
Float_t getNoiseWhiteWidth()
void setHit(Float_t ax, Float_t ay, Float_t atof, Float_t ptof)
Float_t getLayerEfficiencyThickness(Int_t s, Int_t m, Int_t l)
Int_t setup[6][4]
2 leading edges or leading and trailing edge of the signal
HSpectrometer * getSetup(void)
void setWireOffset2(const Float_t f)
void setScalerTime1Err(Float_t m0=0, Float_t m1=0, Float_t m2=0, Float_t m3=0)
Double_t getYinRotLay(Int_t c, Double_t xi, Double_t yi) const
Bool_t useDeltaMomSelection
switch for use/not use delta electron time smearing
Float_t getNoiseLevel(Int_t i)
void setWireOffset1(const Float_t f)
void fillNoiseToGeantCells(Int_t, HMdcCal1Sim *p)
void fillNoise(Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Int_t, Int_t)
Float_t t1maxDeltaElec
delta electron smearing lower time range for t1 [ns]
Float_t noiseLevel[4]
flag is set , if printStatus() is called
TNtuple * distance_time
file pointer for NTuple
void setEndList1(Int_t end)
TFile * myoutput
flag for use/don't use MdcTimeCut container
Bool_t useWireStatOffset
switch for use/not use eff from wire stat container (default = kTRUE)
void setError2(const Float_t f)
void setNTrack2(const Int_t n)
Float_t getEfficiency(Int_t i)
void setDTime1Err(Int_t i, Float_t timeErr)
static Float_t minimumdist[NMAXHITS]
error of drift time2
#define INFO_msg(level, det, text)
HMdcCal1Sim * fCal
pointer to hmdcgeomstruct parameter container
Bool_t useOffsets
offsets are used to substract min tof
vector< HMdcDigiLayEff > vLayEff
simple scaler for manipulating drift times (as done by tdc slopes)
void setNoiseBandWidth(Float_t w)
Bool_t useDeDxTimeScaling
switch on/off efficiency scaling with energyloss
static Float_t fractionOfmaxCharge[NMAXHITS]
flag for efficiency
Bool_t getFlagCutEdge(Int_t j) const
Float_t fillTime2Noise(Int_t)
virtual Int_t getTrack(void)
Bool_t evalWireStat(Int_t, Int_t, Int_t, Int_t)
void setEfficiency(Int_t i, Float_t eff)
static Float_t dTime2Err[NMAXHITS]
error of drift time1
void setTimeCutUse(Bool_t use)
static Float_t theta[NMAXHITS]
efficiency of track in layer
void setNoiseRange(Int_t rangeLo0, Int_t rangeLo1, Int_t rangeLo2, Int_t rangeLo3, Int_t rangeHi0, Int_t rangeHi1, Int_t rangeHi2, Int_t rangeHi3)
void setTime2Real(Float_t t2)
Double_t getHalfPitch(void) const
HMdcCellEff * fCellEff
pointer to cal2 parameter container
HParSet * getContainer(const Text_t *)
static Double_t beta(Int_t id, Double_t p)
HCategory * fGeantKineCat
MDC HGeant input data.
Float_t getAngle(Int_t i)
void setDTime1(Int_t i, Float_t time)
HMdcGeomStruct * geomstruct
pointer to MdcDeDx2 parameter container
void setAngle2(const Float_t f)
Bool_t useDeltaElectrons
switch for use/not use layer thisckness eff loss
void transFromZ0(Double_t &x, Double_t &y, Double_t &z) const
Bool_t getWireStatOffsetUse()
void setWireOffsetUse(Bool_t use)
TGraph p1(xdim, pgrid, resplo)
Float_t getMinimumDist(Int_t i)
void setDeltaElectronUse(Bool_t use, Bool_t useDeltaMomSel=kFALSE, Int_t ionId=109, Float_t t1min=-950., Float_t t1max=400., Float_t momCut=20., Float_t probDelta=2.)
void setStatus2(const Int_t f)
HMdcCal2ParSim * fCal2ParSim
Digitisation "phys" parameters.
Int_t getNHits(void) const
Double_t scaledTimeAboveThreshold(HGeantKine *kine=0, Double_t p=-1, Float_t t1=-999, Float_t t2=-999, Float_t *t2err=0, Int_t s=0, Int_t m=0, Int_t l=0, Int_t c=0, Double_t alpha=0, Double_t mindist=0)
Float_t offsets[4]
switch for use/not use of tof in output
HMdcTimeCut * fTimeCut
pointer to wire status parameter container
Bool_t createoffsets
sigma of the gausian random offset distribution
Float_t effLevel[4]
switch on/off time error scaling with energyloss
HLinkedDataObject * nextMdcHit()
static Float_t dTime2[NMAXHITS]
drift time1 + tof
void setOffsetsUse(Bool_t use)
Float_t calcEffval(Int_t m, Float_t r, Float_t a, Float_t l)
void setNHits(const Int_t n)
void setTdcMode(Int_t mode)
Float_t getEfficiency(Int_t sec, Int_t mod, Int_t lay, Int_t cell)
void setErrorUse(Bool_t use)
void setTime2Noise(Float_t time)
Float_t getDTime2Err(Int_t i)
void resetTrackList(Int_t track=-99)
Float_t getDTime1Err(Int_t i)
Int_t arrayNoise[5]
switch for use/not use of noise generator
void setTime1Real(Float_t t1)
Bool_t testMdcSetup(Int_t s, Int_t m)
void fillNoiseLists(HMdcCal1Sim *cal1, Int_t, Int_t)
Float_t pi
Distance to the sence wire.
void setDeDxUse(Bool_t use)
void setStatus1(const Int_t f)
void setTheta(Int_t i, Float_t th)
#define SEPERATOR_msg(sep, num)
void setCutEdge(Int_t i, Bool_t cut)
Int_t findTrack(Int_t trk)
void setCreateOffsets(Bool_t create=kTRUE)
void storeCell(Float_t, Float_t, Float_t, Int_t, Bool_t, Float_t, Float_t, Float_t)
void setNoiseUse(Bool_t use)
map< HGeantKine *, Float_t >::iterator itDelta
map delta electron candidates to t1 offsets
Bool_t cutTime1(HMdcCal1 *cal)
Bool_t getCutEdge(Int_t i)
void setWireOffset(Int_t i, Float_t off)
Float_t getCellEffLevel(Int_t i)
void getHit(Float_t &ax, Float_t &ay, Float_t &atof, Float_t &ptof)
void calcTime2Digitizer(Int_t, Int_t, Float_t, Float_t, Float_t *, Float_t *)
void setWireStatOffsetUse(Bool_t use)
Double_t calcWireY(Int_t cell) const
HMdcWireStat * fWireStat
pointer to cell efficiency parameter container
void setNoiseLevel(Float_t noise0, Float_t noise1, Float_t noise2, Float_t noise3, Int_t on_off=1)
void setLayerThicknessEffUse(Bool_t use)
static Int_t statusflag[NMAXHITS]
impact angle in coordinate system of the cell
void setMinDist2(const Float_t f)
Float_t fillTime1Noise(Int_t)
Float_t getSignPath(Float_t x) const
Int_t getStatus(Int_t sec, Int_t mod, Int_t lay, Int_t cell)
void setStatus(Int_t i, Int_t stat)
const HGeomVector & getTargetMiddlePoint(void) const
Float_t getImpactAngle(Int_t j) const
Double_t getHalfCatDist(void) const
void calcTimeDigitizer(Int_t, Int_t, Float_t, Float_t, Float_t *, Float_t *)
void handleOverFlow(Int_t, Int_t, Int_t, Int_t)
Int_t getNoiseRangeLo(Int_t i)
Float_t getTheta(Int_t j) const
Bool_t useDeDxScaling
lower beta range for scaling
static Bool_t cutEdge[NMAXHITS]
value for fraction of maximum charge
Bool_t useLayerThickness
switch for use/not use offset from wire stat container (default = kTRUE)
Float_t momMinDeltaCut[6]
delta electron smearing : primary electrons below this mom are considdered to be delta electrons [MeV...
Int_t firstsec
end of the list of hits belonging to the first valid hit
void setTime1Noise(Float_t time)
Float_t getLayerEfficiency(Int_t s, Int_t m, Int_t l)
Float_t time2Error
drift time2 calculated by HMdcCal2ParSim
void setWireStatEffUse(Bool_t use)
HMdcGeantCell * hit
Pointer to cal data category.
void fillArraysReal(Int_t i)
HMessageMgr * getMsg(void)
static Float_t efficiency[NMAXHITS]
time for signal propagation on the wire
Int_t getNTrack(Int_t j) const
map< HGeantKine *, Float_t > mDeltaTrackT0
min mom cut per sector (account for different mirror materials) [MeV/c]
void setStatusList(Int_t i, Int_t stat)
HLocation locnoise
Location for new object.
Float_t getTime1(void) const
void setCellEffUse(Bool_t use)
Float_t time1Error
drift time1 calculated by HMdcCal2ParSim
void resetStatusList(Int_t stat=0)
Float_t getWireOffset(Int_t i)
Int_t getStatus1(void) const
void getIncidence(Float_t &ath, Float_t &aph)
Int_t noiseRangeHi[4]
lower range of noise for each mdc type
Bool_t useCellEff
level of requiered maximum charge to create a signal (for example 20 (=20%))
Bool_t cutTimesDif(HMdcCal1 *cal)
void setFractionOfmaxCharge(Int_t i, Float_t f)
Int_t getNoiseRangeHi(Int_t i)
TGraph p3(xdim, pgrid, resphi)
Float_t momMaxDeltaElecCut
delta electron smearing upper time range for t1 [ns]