22 #include <CLHEP/Random/Randomize.h>
23 #include <CLHEP/Vector/ThreeVector.h>
33 #include <IMPL/LCCollectionVec.h>
34 #include <IMPL/LCFlagImpl.h>
35 #include <IMPL/LCRelationImpl.h>
36 #include <IMPL/TrackerPulseImpl.h>
37 #include <UTIL/CellIDDecoder.h>
38 #include <UTIL/CellIDEncoder.h>
39 #include "UTIL/LCTrackerConf.h"
42 #include <streamlog/streamlog.h>
45 using namespace CLHEP;
47 using namespace marlin;
68 SiStripDigi::SiStripDigi() : Processor(
"SiStripDigi")
71 _description =
"SiStripDigi: Marlin processor intended for detailed digitization of silicon strip sensors";
78 registerProcessorParameter(
"Subdetector",
79 "Subdetector to be digitised",
83 registerProcessorParameter(
"DeplVoltage",
84 "Depletion voltage of a silicon strip detector, set in volts",
88 registerProcessorParameter(
"BiasVoltage",
89 "Bias voltage set on a silicon strip detector, set in volts",
93 registerProcessorParameter(
"Temperature",
94 "Temperature measured on a sensor, set in Kelvins",
98 registerProcessorParameter(
"LandauFluct",
99 "Use internal Landau fluctuations (instead of Geant4)?",
103 registerProcessorParameter(
"LandauBetaGammaCut",
104 "Below this beta*gamma factor internal Landau fluctuations not used",
108 registerProcessorParameter(
"ProductionThreshOnDeltaRays",
109 "Production threshold cut on delta electrons in keV (for Landau fluct.) - use the same as in Geant4 (80keV ~ 0.05 mm)",
113 registerProcessorParameter(
"ElectronicEffects",
114 "Apply electronic effects?",
118 registerProcessorParameter(
"InterStripCapacitance",
119 "Interstrip capacitance, set in pF",
123 registerProcessorParameter(
"BackplaneCapacitance",
124 "Backplane capacitance, set in pF",
128 registerProcessorParameter(
"CouplingCapacitance",
129 "Coupling capacitance, set in pF",
133 registerProcessorParameter(
"ElectronicsNoise",
134 "Noise added by the electronics, set in electrons",
138 registerProcessorParameter(
"FloatingStripsRPhi",
139 "Is every even strip floating in R-Phi?",
143 registerProcessorParameter(
"FloatingStripsZ",
144 "Is every even strip floating in Z?",
148 registerProcessorParameter(
"AbsoluteSpacePrecision",
149 "Absolute digitization space precision, set in microns",
153 registerProcessorParameter(
"RelativeAnglePrecision",
154 "Relative digitization precision when calculating tan(Lorentz angle)",
158 registerProcessorParameter(
"RelativeDriftTimePrecision",
159 "Relative digitization precision when calculating cluster drift time",
163 registerProcessorParameter(
"InputCollectionName",
164 "Name of SimTrackerHit input collection",
166 std::string(
"FTDCollection") );
168 registerProcessorParameter(
"OutputCollectionName",
169 "Name of TrackerPulse output collection",
171 std::string(
"FTDDigits") );
173 registerProcessorParameter(
"RelCollectionNameTrkPlsToSimHit",
174 "Name of relation collection - TrkPulses to SimTrackerHit (if nonzero, created)",
176 std::string(
"FTDDigitsToSimHitsRel") );
178 registerProcessorParameter(
"IntegrationWindow",
179 "Use integration window?",
183 registerProcessorParameter(
"StartIntegration",
184 "Only Simulated hits after the StartIntegration time in ns will be digitized",
188 registerProcessorParameter(
"StopIntegration",
189 "Only Simulated hits before the StopIntegration time in ns will be digitized",
193 registerProcessorParameter(
"pitchFront",
194 "Pitch of the front sensor family in the center of the sensors, set in um",
198 registerProcessorParameter(
"pitchRear",
199 "Pitch of the rear sensor family in the center of the sensors, set in um",
259 #ifdef ROOT_OUTPUT_LAND
260 _rootFile =
new TFile(
"Digi_FTD.root",
"RECREATE");
263 _tree =
new TTree(
"Digi",
"Digi info");
265 std::map<int,std::string> names;
275 for(std::map<int,double>::iterator it = _variables.begin();
276 it != _variables.end(); ++it)
278 _tree->Branch(names[it->first].c_str(),&(it->second),
279 (names[it->first]+
"/D").c_str());
291 streamlog_out(MESSAGE3) <<
DGREEN
292 <<
" Processing run: "
294 << (run->getRunNumber())
295 << std::endl << std::endl;
298 run->parameters().setValue (
"[ProcessorName]" , name() );
312 static int errors_occured = 0;
319 #ifdef ROOT_OUTPUT_LAND
320 for(std::map<int,double>::iterator it = _variables.begin();
321 it != _variables.end(); ++it)
329 LCCollection * colOfSimHits = 0;
332 if (event->getEventNumber() == 0)
334 streamlog_out(MESSAGE3) <<
" "
337 <<
"LCCollection processed:"
339 << std::endl << std::endl;
344 for(ConstStringVec::const_iterator colName = strVec->begin();
345 colName != strVec->end(); ++colName)
350 if ( (event->getCollection(*colName))->getTypeName() ==
351 LCIO::SIMTRACKERHIT )
354 colOfSimHits =
event->getCollection(*colName);
356 if (event->getEventNumber() == 0)
358 streamlog_out(MESSAGE3) <<
" " << *colName
365 streamlog_out(ERROR) <<
"Required collection: "
367 <<
" found, but NOT of SIMTRACKERHIT type!!!"
375 if (colOfSimHits == 0)
377 streamlog_out(WARNING) <<
"Required collection: "
384 if (event->getEventNumber() == 0)
386 streamlog_out(MESSAGE3) << std::endl;
391 if( (event->getEventNumber()+1)%100 == 0 )
393 streamlog_out(MESSAGE3) <<
DYELLOW
394 <<
" Processing event: "
397 << (
event->getEventNumber()+1)
398 << std::endl << std::endl;
403 if(colOfSimHits != 0)
409 CellIDDecoder<SimTrackerHit> cellIDDec(colOfSimHits);
413 int nHits = colOfSimHits->getNumberOfElements();
417 for (
int i=0; i<nHits; ++i)
421 SimTrackerHit * simHit =
dynamic_cast<SimTrackerHitImpl*
>( colOfSimHits->getElementAt(i) );
423 #ifndef ROOT_OUTPUT_LAND
436 double hitPos[3] = {*(simHit->getPosition()) *
mm,
437 *(simHit->getPosition()+1) *
mm, *(simHit->getPosition()+2) *
mm};
438 float hitMom[3] = {*(simHit->getMomentum()) *
GeV,
439 *(simHit->getMomentum()+1) *
GeV, *(simHit->getMomentum()+2) *
GeV};
440 float hitdEdx = simHit->getEDep() *
GeV;
441 float hitTime = simHit->getTime() *
ns;
442 float hitPath = simHit->getPathLength() *
mm;
456 const int hitLayerID = cellIDmap[
"layer"];
457 const int hitLadderID = cellIDmap[
"module"];
458 const int hitSensorID = cellIDmap[
"sensor"];
465 int hitCellID = cellIDDec(simHit).lowWord();
468 MCParticle * mcPart = simHit->getMCParticle();
477 simDigiHit->setEDep(hitdEdx);
478 simDigiHit->setTime(hitTime);
479 simDigiHit->setPathLength(hitPath);
480 simDigiHit->setCellID0(hitCellID);
484 simDigiHit->setMCParticle(mcPart);
533 std::vector<StripType> stripTypesvect;
607 LCFlagImpl flag1(0), flag2(0);
609 flag1.setBit(LCIO::TRAWBIT_ID1);
610 flag2.setBit(LCIO::LCREL_WEIGHTED);
612 colOfTrkPulses->setFlag(flag1.getFlag());
615 colOfRelPlsToSim->setFlag(flag2.getFlag());
619 CellIDEncoder<TrackerPulseImpl> cellEnc(
620 LCTrackerCellID::encoding_string()+
",stripType:2,stripID:11",
624 SensorStripMap::iterator iterSMap;
625 StripChargeMap::iterator iterChMap;
628 for(iterSMap=sensorMap.begin(); iterSMap!=sensorMap.end(); ++iterSMap)
630 int cellID = iterSMap->first;
632 for(std::vector<StripType>::iterator stripTypeIt = stripTypesvect.begin();
633 stripTypeIt != stripTypesvect.end(); ++stripTypeIt)
636 for(iterChMap=iterSMap->second[stripType].begin();
637 iterChMap!=iterSMap->second[stripType].end(); ++iterChMap)
639 int stripID = iterChMap->first;
643 if(iterChMap->second->getCharge() > 0.*
fC)
645 TrackerPulseImpl * trkPulse =
new TrackerPulseImpl();
650 cellEnc.setCellID(trkPulse);
652 trkPulse->setTime(iterChMap->second->getTime()/
ns);
653 trkPulse->setCharge(iterChMap->second->getCharge()/
fC);
654 trkPulse->setTrackerData(0);
660 float weightSum = iterChMap->second->getSimHitWeightSum();
662 for(SimTrackerHitMap::const_iterator iterSHM=simHitMap.begin();
663 iterSHM!=simHitMap.end(); ++iterSHM)
666 LCRelationImpl * relation =
new LCRelationImpl;
667 SimTrackerHit * simHit = iterSHM->first;
671 relation->setFrom(trkPulse);
672 relation->setTo(simHit);
676 weight = float(iterSHM->second)/weightSum;
682 relation->setWeight(weight);
687 colOfRelPlsToSim->addElement(relation);
696 colOfTrkPulses->addElement(trkPulse);
705 delete iterChMap->second;
710 delete [] iterSMap->second;
722 if(errors_occured != 0)
724 streamlog_out(DEBUG4) <<
"SimTrackerHit outside "
725 << errors_occured <<
" times outside of integration time of sensor"
730 #ifdef ROOT_OUTPUT_LAND
756 streamlog_out(MESSAGE3) << std::endl
758 <<
"Time per event: "
759 << std::setiosflags(std::ios::fixed | std::ios::internal )
760 << std::setprecision(3)
764 << std::setprecision(3)
768 <<
"Processor succesfully finished!"
775 #ifdef ROOT_OUTPUT_LAND
807 DigiClusterVec::iterator iterVec;
810 double diffSigma = 0.;
813 Hep3Vector shiftLorentz(0.,0.,0.);
816 double driftTime = 0.;
819 double chargeCollect = 0.;
833 streamlog_out(ERROR) <<
"SiStripDigi::digitize - "
835 <<
" do not exist. " << std::endl;
840 for( iterVec=hClusterVec.begin(); iterVec!=hClusterVec.end(); ++iterVec )
857 diffSigma *= 2 * driftTime;
858 diffSigma = sqrt(diffSigma);
884 const double zRot = pointRot.getZ();
888 double meanRot = pointRot.getY();
894 double sigmaSqrt2 = diffSigma * sqrt(2.);
895 double primAtA = 0.5*( 1. + erf( ((yorigenRot+iMinStrip*sensorPitch) - meanRot)/sigmaSqrt2) );
900 SensorStripMap::iterator iterSMap;
901 StripChargeMap::iterator iterChMap;
907 for(
int i=iMinStrip; i<=iMaxStrip; ++i)
913 primAtB = 0.5*( 1. + erf( ((yorigenRot+(i+1)*sensorPitch) - meanRot)/sigmaSqrt2) );
916 charge = (primAtB - primAtA) * chargeCollect;
922 iterSMap = sensorMap.find(cluster->
getCellID());
925 if(iterSMap != sensorMap.end())
928 iterChMap = iterSMap->second[stripType].find(i);
931 if(iterChMap != iterSMap->second[stripType].end())
934 signal = iterChMap->second;
958 iterSMap->second[stripType][i] = signal;
976 stripMap[stripType][i] = signal;
977 sensorMap[cluster->
getCellID()] = stripMap;
1009 nClusters = nSubSteps + 1;
1013 nClusters = nSubSteps;
1017 Hep3Vector clusterStep = hit->
get3Step()/(nClusters);
1020 MCParticle * mcPart =
dynamic_cast<MCParticle *
>(hit->getMCParticle());
1022 double partMass = 0.;
1023 double betaGamma = 0.;
1026 partMass = hit->getMCParticle()->getMass()*
GeV;
1028 if(mcPart!=0 && partMass!=0.)
1030 betaGamma = partMomMag / partMass;
1033 double clusterStepSize = clusterStep.mag();
1035 #ifdef ROOT_OUTPUT_LAND
1043 bool lowEnergyPart =
false;
1047 lowEnergyPart =
true;
1051 for(
int i = 0; i<nClusters; ++i)
1064 eLoss = hit->getEDep()/nClusters;
1067 #ifdef ROOT_OUTPUT_LAND
1082 hCluster =
new DigiCluster(+1, hit->getTime(), eLoss,
1087 hClusterVec.push_back(hCluster);
1092 streamlog_out(MESSAGE2) << std::endl;
1109 SensorStripMap::iterator iterSMap;
1110 StripChargeMap::iterator iterChMap;
1112 short int layerID = 0;
1113 short int ladderID = 0;
1114 short int sensorID = 0;
1119 std::vector<StripType> stvec;
1124 for(iterSMap=sensorMap.begin(); iterSMap!=sensorMap.end(); ++iterSMap)
1128 layerID = bfMap[
"layer"];
1129 ladderID= bfMap[
"module"];
1130 sensorID= bfMap[
"sensor"];
1137 for(std::vector<StripType>::iterator itT = stvec.begin(); itT != stvec.end(); ++itT)
1141 for(iterChMap=(iterSMap->second[STRIP]).begin();
1142 iterChMap!=(iterSMap->second[STRIP]).
end(); ++iterChMap)
1144 const int iStrip = iterChMap->first;
1145 int iStripLeft = iStrip - 1;
1146 int iStripRight = iStrip + 1;
1150 signal = iterChMap->second;
1152 const double chargeTotal = signal->
getCharge();
1178 const double chargeLeft = chargeTotal*Kf;
1179 const double chargeRight = chargeTotal*Kf;
1180 const double chargeCentr = chargeTotal - chargeLeft - chargeRight;
1183 for(SimTrackerHitMap::const_iterator iterSHM=signal->
getSimHitMap().begin();
1186 simHitMapLeft[iterSHM->first] = iterSHM->second * Kf;
1187 simHitMapCentr[iterSHM->first] = iterSHM->second * chargeCentr/chargeTotal;
1188 simHitMapRight[iterSHM->first] = iterSHM->second * Kf;
1192 const double time = signal->
getTime();
1194 if( (iStripLeft)>=0 )
1196 if(stripMap[STRIP].find(iStripLeft) != stripMap[STRIP].
end())
1198 stripMap[STRIP][iStripLeft]->updateCharge(chargeLeft);
1199 stripMap[STRIP][iStripLeft]->updateSimHitMap(simHitMapLeft);
1203 stripMap[STRIP][iStripLeft] =
new Signal(chargeLeft, time);
1204 stripMap[STRIP][iStripLeft]->updateSimHitMap(simHitMapLeft);
1210 if(stripMap[STRIP].find(iStrip) != stripMap[STRIP].
end())
1212 stripMap[STRIP][iStrip]->updateCharge(chargeCentr);
1213 stripMap[STRIP][iStrip]->updateSimHitMap(simHitMapCentr);
1217 stripMap[STRIP][iStrip] =
new Signal(chargeCentr, time);
1218 stripMap[STRIP][iStrip]->updateSimHitMap(simHitMapCentr);
1225 if (stripMap[STRIP].find(iStripRight) != stripMap[STRIP].end())
1227 stripMap[STRIP][iStripRight]->updateCharge(chargeRight);
1228 stripMap[STRIP][iStripRight]->updateSimHitMap(simHitMapRight);
1232 stripMap[STRIP][iStripRight] =
new Signal(chargeRight, time);
1233 stripMap[STRIP][iStripRight]->updateSimHitMap(simHitMapRight);
1238 delete iterChMap->second;
1243 delete [] iterSMap->second;
1246 iterSMap->second = stripMap;
1264 std::vector<StripType> stvec;
1268 for(SensorStripMap::iterator iterSMap=sensorMap.begin();
1269 iterSMap!=sensorMap.end(); ++iterSMap)
1271 for(std::vector<StripType>::iterator itType = stvec.begin();
1272 itType != stvec.end(); ++itType)
1274 for(StripChargeMap::iterator iterChMap=iterSMap->second[(*itType)].begin();
1275 iterChMap!=iterSMap->second[(*itType)].end();
1278 const double elNoise =
_genGauss->fire();
1280 iterChMap->second->updateCharge(elNoise);
1297 streamlog_out(MESSAGE2) <<
" * Layer "
1304 << std::setprecision(2)
1305 << std::endl <<
" Local B field: "
1307 << std::setprecision(0)
1320 streamlog_out(DEBUG4) <<
"-- PRE-STEP Point" << std::endl;
1323 streamlog_out(DEBUG4) <<
"-- POST-STEP Point" << std::endl;
1336 streamlog_out(ERROR) <<
"SiStripDigi::transformSimHit: "
1337 <<
"Pre-step Position out of Sensor!\n" << std::endl;
1345 streamlog_out(ERROR) <<
"SiStripDigi::transformSimHit: "
1346 <<
"Post-step Position out of Sensor!\n" << std::endl;
1395 streamlog_out(ERROR) <<
"Problem to calculate total drift time. "
1396 <<
"Electrons at position: "
1397 << pos <<
" are out of range!" << std::endl;
1423 streamlog_out(ERROR) <<
"Problem to calculate total drift time."
1424 <<
" Holes at position: " << std::setprecision(5)
1425 << pos <<
" are out of range!"
1437 return (holeIntSolver.
Integrate(pos, 0.));
1449 streamlog_out(ERROR) << std::setprecision(3)
1450 <<
"Electric field at required position[um]: " << pos/um
1451 <<
" not defined!" << std::endl;
1465 static double vmElec = 1.53 * pow(
_temp,-0.87) * 1.E9 *
cm/
s;
1466 static double EcElec = 1.01 * pow(
_temp,+1.55) *
V/
cm;
1467 static double betaElec = 2.57 * pow(
_temp,+0.66) * 1.E-2;
1470 double E =
getEField(pos);
if (E < 0.) E = -E;
1473 return ( vmElec/EcElec * 1./(pow(1. + pow((E/EcElec),betaElec),(1./betaElec))) );
1482 static double vmHole = 1.62 * pow(
_temp,-0.52) * 1.E8 *
cm/
s;
1483 static double EcHole = 1.24 * pow(
_temp,+1.68) *
V/
cm;
1484 static double betaHole = 0.46 * pow(
_temp,+0.17);
1494 return ( vmHole/EcHole * 1./(pow(1. + pow((E/EcHole),betaHole),(1./betaHole))) );
1508 static float rElec = 1.13 + 0.0008*(
_temp - 273);
1513 streamlog_out(ERROR)
1514 <<
"Problem to calculate Lorentz angle. Electrons at position: "
1515 << pos <<
" are out of range!" << std::endl;
1520 Hep3Vector shiftLorentz(0.,0.,0.);
1526 shiftLorentz.setY(integral * rElec *
_magField.getZ() * -1.);
1527 shiftLorentz.setZ(integral * rElec *
_magField.getY());
1532 return (shiftLorentz);
1545 static float rHole = 0.72 - 0.0005*(
_temp - 273);
1550 streamlog_out(ERROR) <<
"Problem to calculate Lorentz angle."
1551 <<
" Holes at position: " << pos <<
" are out of range!"
1557 Hep3Vector shiftLorentz(0.,0.,0.);
1560 double integral = holeIntSolver.
Integrate(0., pos);
1562 shiftLorentz.setY(integral * rHole *
_magField.getZ());
1563 shiftLorentz.setZ(integral * rHole *
_magField.getY() * -1.);
1566 return (shiftLorentz);
1609 streamlog_out(MESSAGE1) << std::setiosflags(std::ios::fixed | std::ios::internal | std::ios::showpos)
1610 << std::setprecision(2)
1613 << std::setprecision(1)
1614 <<
" Pos X [um]: " << std::setw(6) << cluster.
getPosX()/
um
1615 << std::setprecision(3)
1616 <<
" Pos Y [mm]: " << std::setw(6) << cluster.
getPosY()/
mm
1617 <<
" Pos Z [mm]: " << std::setw(6) << cluster.
getPosZ()/
mm
1618 << std::resetiosflags(std::ios::internal | std::ios::showpos)
1619 << std::setprecision(0)
1628 DigiClusterVec::const_iterator iterClusters;
1630 streamlog_out(MESSAGE1) <<
" " << info <<
": " << clusterVec.size() <<
" clusters" <<std::endl;
1631 for ( iterClusters = clusterVec.begin(); iterClusters != clusterVec.end(); ++iterClusters ) {
1641 streamlog_out(MESSAGE2) <<
" " << info <<
":" << std::endl;
1642 streamlog_out(MESSAGE2) << std::fixed
1643 << std::setprecision(1)
1645 <<
" DepE [keV]: " << hit->getEDep()/
keV
1646 << std::setprecision(3)
1647 << std::setiosflags(std::ios::showpos)
1651 <<
" Path [mm]: " << hit->getPathLength()/
mm
1654 << std::resetiosflags(std::ios::showpos)
1655 << std::setprecision(0)
1664 streamlog_out(MESSAGE3) << std::endl
1668 <<
"SiStripDigi parameters:"
1671 << std::endl << std::endl;
1673 streamlog_out(MESSAGE3) << std::setiosflags(std::ios::fixed | std::ios::internal )
1674 << std::setprecision(2)
1675 <<
" Sensor depletion voltage [V]: " << std::setw(6) <<
_Vdepl/
V << std::endl
1676 <<
" Sensor bias voltage [V]: " << std::setw(6) <<
_Vbias/
V << std::endl
1677 <<
" Temperature set on sensor [K]: " << std::setw(6) <<
_temp/
K << std::endl;
1679 streamlog_out(MESSAGE3) <<
" Mutual interstrip capacitance [pF]: " << std::setw(6) <<
_capInterStrip<< std::endl
1680 <<
" Strip-to-backplane capacitance [pF]: " << std::setw(6) <<
_capBackPlane << std::endl
1681 <<
" AC coupling - capacitance [pF]: " << std::setw(6) <<
_capCoupl << std::endl
1682 <<
" Electronics noise - ENC [fC]: " << std::setw(6) <<
_elNoise/
fC << std::endl << std::endl;
1684 streamlog_out(MESSAGE3) <<
" Read-out R-Phi pitch is 2x geom. pitch." << std::endl;
1686 streamlog_out(MESSAGE3) <<
" Read-out Z pitch is 2x geom. pitch." << std::endl;
1688 streamlog_out(MESSAGE3) <<
" " << std::endl
1689 <<
" Internal Landau fluctuations?: " <<
" yes" << std::endl
1691 <<
" Beta*Gamma limit for Landau fluct: " << std::setw(6) <<
_landauBetaGammaCut << std::endl;
1694 streamlog_out(MESSAGE3) <<
" " << std::endl
1695 <<
" Internal Landau fluctuations?: " <<
" no" << std::endl;
1697 streamlog_out(MESSAGE3) <<
" " << std::endl
1698 <<
" Digi precision in space [um]: " << std::setw(6) <<
_epsSpace/
um << std::endl
1699 <<
" Digi rel. precision in Lorentz angle: " << std::setw(6) <<
_epsAngle << std::endl
1700 <<
" Digi rel. precision in Drift time: " << std::setw(6) <<
_epsTime << std::endl
1701 << std::resetiosflags(std::ios::showpos)
1702 << std::setprecision(0)
1712 SensorStripMap::const_iterator iterSMap;
1713 StripChargeMap::const_iterator iterChMap;
1717 short int layerID = 0;
1718 short int ladderID = 0;
1719 short int sensorID = 0;
1723 streamlog_out(MESSAGE1) <<
" Digi results - " << info
1724 <<
":" << std::endl;
1726 for (iterSMap=sensorMap.begin(); iterSMap!=sensorMap.end(); ++iterSMap) {
1728 cellID = iterSMap->first;
1730 layerID = bfMap[
"layer"];
1731 ladderID= bfMap[
"module"];
1732 sensorID= bfMap[
"sensor"];
1736 streamlog_out(MESSAGE1) << std::endl
1737 <<
" Layer: " << layerID
1738 <<
" Ladder: " << ladderID
1739 <<
" Sensor: " << sensorID
1743 for (iterChMap=iterSMap->second[
STRIPRPHI].begin(); iterChMap!=iterSMap->second[
STRIPRPHI].end(); ++iterChMap) {
1745 stripID = iterChMap->first;
1746 streamlog_out(MESSAGE1) <<
" Strip number in R-Phi: " << stripID
1747 << std::setiosflags(std::ios::fixed | std::ios::internal )
1748 << std::setprecision(2)
1749 <<
" Total charge [fC]: " << iterChMap->second->getCharge() /
fC
1751 << std::setprecision(0)
1756 for (iterChMap=iterSMap->second[
STRIPZ].begin(); iterChMap!=iterSMap->second[
STRIPZ].end(); ++iterChMap) {
1758 stripID = iterChMap->first;
1759 streamlog_out(MESSAGE1) <<
" Strip number in Z: " << stripID
1760 << std::setiosflags(std::ios::fixed | std::ios::internal )
1761 << std::setprecision(2)
1762 <<
" Total charge [fC]: " << iterChMap->second->getCharge() /
fC
1764 << std::setprecision(0)
1767 streamlog_out(MESSAGE1) << std::endl;
double getElecMobility(double pos)
Get method - returns ELECTRON mobility (parameters: electric intenzity in V/cm, respectively position...
void set3Position(const CLHEP::Hep3Vector &position)
Set cluster position Three vector.
virtual double getSensorThick(short int layerID) const
Get sensor thickness.
double getElecDriftTime(double pos)
Get method - returns total ELECTRON drift time (parameters: electron position in cm).
double getElecDiffusivity(double pos)
Get method - returns ELECTRON diffusivity (parameters: electron mobility in cm^2/s, respectively position in cm).
static SiStripGeom * Build(const std::string &detector, const double &pitchFront, const double &pitchRear)
double _pitchRear
Pitch in the rear sensors (in the middle)
short int getLayerID() const
Get layer ID.
virtual CLHEP::Hep3Vector transformPointToLocal(short int layerID, short int ladderID, short int sensorID, const CLHEP::Hep3Vector &point)=0
Transform given point from global ref. system to local ref. system (sensor)
double getCharge() const
Get signal.
double getPosZ() const
Get posStep position Z.
short int _currentLadderID
Actual ladder ID.
double getHoleDriftTime(double pos)
Get method - returns total HOLE drift time (parameters: hole position in cm).
short int getLadderID() const
Get ladder ID.
CLHEP::Hep3Vector get3Step() const
Get step.
void setLayerID(short int iLayer)
Set layer ID.
virtual CLHEP::Hep3Vector transformPointToRotatedLocal(const int &diskID, const int &sensorID, const CLHEP::Hep3Vector &point) const =0
Transforming a given point to the local ref.
double _pitchFront
Pitch in the front sensors (in the middle)
CLHEP::Hep3Vector get3PrePosition() const
Get preStep position Three vector.
double getElecVelocity(double pos)
Get method - returns ELECTRON actual velocity, calculated as follows:
virtual void init()
Method called at the beginning of data processing - used for initialization.
void genNoise(SensorStripMap &sensorMap)
Method generating random noise using Gaussian distribution and add this effect to the final results...
Digitization hit inheritad from LCIO SimTrackerHitImpl, which naturally extends basic features of Sim...
virtual void processEvent(LCEvent *event)
Method called for each event - used for event data processing.
CLHEP::Hep3Vector get3Momentum() const
Get momentum Three vector.
virtual double getSensorLength(short int layerID) const
Get sensor length.
void digitize(const SimTrackerDigiHit *hit, SensorStripMap &sensorMap)
Method digitizing given SimTrackerDigiHit - takes into account all relevant physical processes: landa...
float _capBackPlane
Strip-to-backplane capacitance.
void printProcessorParams() const
Method printing processor parameters.
Double precision Romberg integration solver (Template class represents class whose method is to be in...
std::map< int, StripChargeMap * > SensorStripMap
std::map< EVENT::SimTrackerHit *, float > SimTrackerHitMap
double getPreX() const
Get preStep position X.
void setDriftTime(double driftTime)
Set cluster total drift time.
double getPosX() const
Get cluster position X.
SiEnergyFluct * _fluctuate
const std::vector< std::string > ConstStringVec
std::vector< DigiCluster * > DigiClusterVec
virtual void processRunHeader(LCRunHeader *run)
Method called for each run - used for run header processing.
double _prodThreshOnDeltaRays
Production threshold cut on delta electrons in keV (for Landau fluct.) - use the same as in Geant4 (8...
bool _integrationWindow
Use integration window?
void setPrePosition(double pos[3], float momentum[3], float pathLength)
Set preStep position of a hit.
Signal class holds all information that one gets from strip, pixel, etc ...
double getPosZ() const
Get cluster position Z.
virtual std::string getGearType()
Get gear type.
CLHEP::Hep3Vector getHoleLorentzShift(double pos)
Method used for precise calculation of tan(Lorentz angle) - an angle of HOLES deflection due to magne...
void printStripsInfo(std::string info, const SensorStripMap &sensorMap) const
Method printing info about signals at each strip.
virtual CLHEP::Hep3Vector get3MagField()
Get magnetic field - Three vector.
std::string _relColNamePlsToSim
LCIO relation collection name - TrkPulse (Digit) <-> SimTrkHit.
CLHEP::Hep3Vector _magField
Magnetic field in T in detector reference system.
float _elNoise
CMS-like (common mode subtracted) noise added to the signal.
double getPreY() const
Get preStep position Y.
double getElecInvVelocity(double pos)
Get method - returns actual ELECTRON inverse velocity, calculated as.
double getTime() const
Get time when signal was created.
double getStepSize() const
Get step size.
void setPosPosition(double pos[3], float momentum[3], float pathLength)
Set posStep position of a hit (parameters: preStep position, momentum at this position and total path...
virtual bool isPointInsideSensor(short int layerID, short int ladderID, short int sensorID, const CLHEP::Hep3Vector &point) const =0
Get info whether the given point is inside of Si sensor.
double SampleFluctuations(const MCParticle *part, const double length)
Method providing energy loss fluctuations, the model used to get the fluctuations is essentially the ...
void transformSimHit(SimTrackerDigiHit *simDigiHit)
Method transforming given SimTrackerHit into local ref.
std::string _inColName
LCIO input collection name.
short int _currentSensorID
Actual sensor ID.
double _startIntegration
Start time of integration of the sensors in ns (everything before this value will not be digitized) ...
double _stopIntegration
Stop time of integration of the sensors in ns(everything after this value will not be digitized) ...
short int getLayerID() const
Get layer ID.
bool _floatStripsRPhi
Is every even strip floating in R-Phi?
Digitization cluster class.
virtual void updateCanonicalCellID(const int &cellID, const int &stripType, const int &stripID, UTIL::BitField64 *bf)=0
Stores the cellID0 and cellID1 of the LCIO object to the file.
void setLadderID(short int iLadder)
Set ladder ID.
void printHitInfo(std::string info, const SimTrackerDigiHit *hit) const
Method printing hit info (parameter: info - extra information)
float _Vdepl
Sensor depletion voltage in volts.
void calcCrossTalk(SensorStripMap &sensorMap)
Method that calculates crosstalk effect, i.e.
void calcClusters(const SimTrackerDigiHit *hit, DigiClusterVec &hClusterVec)
Method that calculates e-h clusters, where clusters are worked out from the hits (simulated in Geant ...
double getPosY() const
Get cluster position Y.
void updateCharge(double charge)
Update signal.
void printClustersInfo(std::string info, const DigiClusterVec &clusterVec) const
Method printing clusters info (parameter: info - extra information)
float _temp
Sensor temperature in Kelvins.
virtual int getStripID(const int &layerID, const int &sensorID, const double &posRPhi, const double &posZ) const =0
Get strip ID.
float getTime() const
Get time when the cluster has been generated by a particle.
short int _currentLayerID
Actual layer ID.
float _epsTime
Relative digi precision in Drift time.
virtual int getSensorNStrips(const int &layerID, const int &sensorID) const =0
Get number of strips in Z axis (in each sensor)
double getPreZ() const
Get preStep position Z.
CLHEP::RandGauss * _genGauss
Random number generator - Gaussian distribution.
void setSensorID(short int iSensor)
Set sensor ID.
SiStripGeom * _geometry
All geometry information from Gear xml file.
virtual void check(LCEvent *event)
Method called after each event - used for data checking.
bool _floatStripsZ
Is every even strip floating in Z?
CLHEP::Hep3Vector getElecLorentzShift(double posZ)
Method used for precise calculation of tan(Lorentz angle) - an angle of ELECTRON deflection due to ma...
float _sensorThick
Actual sensor - Si wafer thickness in system of units.
bool _landauFluct
Define if internal Landau fluctuations (instead of Geant4) used.
void updateSimHitMap(EVENT::SimTrackerHit *simHit, float weight)
Update MC truth information about SimTrackerHits, which contributed.
double getHoleInvVelocity(double pos)
Get method - returns actual HOLE inverse velocity, calculated as follows:
std::vector< LCCollection * > LCCollectionVec
void setMomentum(float p[3])
Set particle momentum at preStep position.
double Integrate(double endPointA, double endPointB)
This method returns a definite integral of function fce calculated in interval (a,b) using so-called Romberg algorithm.
Special class providing particle energy loss fluctuations in Si material (Landau fluctuations).
float _landauBetaGammaCut
Below this beta*gamma factor internal Landau fluctuations not used.
std::string _outColName
LCIO output collection name.
void printClusterInfo(const DigiCluster &cluster) const
Method printing cluster info.
virtual double getLayerHalfPhi(const int &layerID) const
Get layer semiangle.
CLHEP::Hep3Vector get3PosPosition() const
Get posStep position Three vector.
double getHoleVelocity(double pos)
Get method - returns HOLE actual velocity, calculated as follows:
std::map< int, Signal * > StripChargeMap
float _Vbias
Sensor bias voltage in volts.
virtual void initGearParams()=0
Method initializing class - reads Gear parameters from XML file Pure virtual method, have to be implemented by a concrete instance.
double getEField(double pos)
Get method - returns electric intensity (parameters: position X in cm).
short int getSensorID() const
Get sensor ID.
virtual double getSensorPitch(const int &layerID, const int &sensorID, const double &posZ) const =0
Get sensor pitch.
float _epsAngle
Relative digi precision in Lorentz angle.
float _capCoupl
AC coupling - capacitance.
void set3PrePosition(const CLHEP::Hep3Vector &prePosition)
Set preStep position Three vector.
void set3PosPosition(const CLHEP::Hep3Vector &posPosition)
Set posStep Three vector.
virtual std::map< std::string, int > decodeCellID(const UTIL::BitField64 &cellDec) const =0
Encode cellID.
int getCellID() const
Get cell ID.
virtual int getLayerRealID(short int layerID) const
Get layer real ID.
EVENT::SimTrackerHit * getSimTrackerHit() const
Get pointer to SimTrackerHit from which the given cluster has been created.
double getHoleMobility(double pos)
Get method - returns HOLE mobility (parameters: electric intenzity in V/cm, respectively position X i...
float _epsSpace
Absolute digi precision in space in um.
bool _electronicEffects
Add crosstalk + noise?
virtual CLHEP::Hep3Vector transformVecToLocal(short int layerID, short int ladderID, short int sensorID, const CLHEP::Hep3Vector &vec)=0
Transform given vector from global ref. system to local ref. system (sensor)
EVENT::SimTrackerHit * getSimTrackerHit() const
Get original SimTrackerHit.
SiStripDigi anSiStripDigi
double getHoleDiffusivity(double pos)
Get method - returns HOLE diffusivity (parameters: hole mobility in cm^2/s, respectively position in ...
void set3Momentum(const CLHEP::Hep3Vector &momentum)
Set particle Three momentum.
virtual void end()
Method called after all data processing.
void setSimTrackerHit(EVENT::SimTrackerHit *simHit)
Set original SimTrackerHit.
float _capInterStrip
Mutual interstrip capacitance.
double getPosY() const
Get posStep position Y.
const SimTrackerHitMap & getSimHitMap() const
Get MC truth information about SimTrackerHits, which contributed.
double getPosX() const
Get posStep position X.
short int getSensorID() const
Get sensor ID.
short int getCharge() const
Get cluster charge.
int getNCarriers() const
Get number of charge carriers.