#include <FP420DigiMain.h>
Definition at line 32 of file FP420DigiMain.h.
typedef float FP420DigiMain::Amplitude |
Definition at line 37 of file FP420DigiMain.h.
Definition at line 39 of file FP420DigiMain.h.
typedef std::map<int, float, std::less<int> > FP420DigiMain::hit_map_type |
Definition at line 36 of file FP420DigiMain.h.
Definition at line 40 of file FP420DigiMain.h.
FP420DigiMain::FP420DigiMain | ( | const edm::ParameterSet & | conf | ) |
Definition at line 42 of file FP420DigiMain.cc.
References addNoisyPixels, conf_, gather_cfg::cout, elossCut, ENC, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), ldrift, ldriftX, ldriftY, moduleThickness, ndigis, noNoise, numStrips, numStripsW, numStripsX, numStripsXW, numStripsY, numStripsYW, pitch, pitchW, pitchX, pitchXW, pitchY, pitchYW, theApplyTofCut, theDConverterFP420, theElectronPerADC, theFP420NumberingScheme, theGNoiseFP420, theHitDigitizerFP420, thePileUpFP420, theThreshold, thez420, thezD2, thezD3, theZSuppressFP420, Thick300, tofCut, verbosity, and xytype.
:conf_(conf){ std::cout << "Creating a FP420DigiMain" << std::endl; ndigis=0; verbosity = conf_.getUntrackedParameter<int>("VerbosityLevel"); theElectronPerADC= conf_.getParameter<double>("ElectronFP420PerAdc"); theThreshold = conf_.getParameter<double>("AdcFP420Threshold"); noNoise = conf_.getParameter<bool>("NoFP420Noise"); addNoisyPixels = conf_.getParameter<bool>("AddNoisyPixels"); thez420 = conf_.getParameter<double>("z420"); thezD2 = conf_.getParameter<double>("zD2"); thezD3 = conf_.getParameter<double>("zD3"); theApplyTofCut = conf_.getParameter<bool>("ApplyTofCut"); tofCut = conf_.getParameter<double>("LowtofCutAndTo200ns"); // sn0 = 3;// number of stations // pn0 = 6;// number of superplanes // rn0 = 3; // number of sensors in superlayer xytype = 2; if(verbosity>0) { std::cout << "theApplyTofCut=" << theApplyTofCut << " tofCut=" << tofCut << std::endl; std::cout << "FP420DigiMain theElectronPerADC=" << theElectronPerADC << " theThreshold=" << theThreshold << " noNoise=" << noNoise << std::endl; } // X (or Y)define type of sensor (xytype=1 or 2 used to derive it: 1-Y, 2-X) // for every type there is normal pixel size=0.05 and Wide 0.400 mm Thick300 = 0.300; // = 0.300 mm normalized to 300micron Silicon //ENC= 2160.; // EquivalentNoiseCharge300um = 2160. + other sources of noise ENC= 960.; // EquivalentNoiseCharge300um = 2160. + other sources of noise ldriftX = 0.050; // in mm(xytype=1) ldriftY = 0.050; // in mm(xytype=2) moduleThickness = 0.250; // mm(xytype=1)(xytype=2) pitchY= 0.050; // in mm(xytype=1) pitchX= 0.050; // in mm(xytype=2) //numStripsY = 200; // Y plate number of strips:200*0.050=10mm (xytype=1) //numStripsX = 400; // X plate number of strips:400*0.050=20mm (xytype=2) numStripsY = 144; // Y plate number of strips:144*0.050=7.2mm (xytype=1) numStripsX = 160; // X plate number of strips:160*0.050=8.0mm (xytype=2) pitchYW= 0.400; // in mm(xytype=1) pitchXW= 0.400; // in mm(xytype=2) //numStripsYW = 50; // Y plate number of W strips:50 *0.400=20mm (xytype=1) - W have ortogonal projection //numStripsXW = 25; // X plate number of W strips:25 *0.400=10mm (xytype=2) - W have ortogonal projection numStripsYW = 20; // Y plate number of W strips:20 *0.400=8.0mm (xytype=1) - W have ortogonal projection numStripsXW = 18; // X plate number of W strips:18 *0.400=7.2mm (xytype=2) - W have ortogonal projection // tofCut = 1350.; // Cut on the particle TOF range = 1380 - 1500 elossCut = 0.00003; // Cut on the particle TOF = 100 or 50 if(verbosity>0) std::cout << "FP420DigiMain moduleThickness=" << moduleThickness << std::endl; theFP420NumberingScheme = new FP420NumberingScheme(); float noiseRMS = ENC*moduleThickness/Thick300; // Y: if (xytype ==1) { numStrips = numStripsY; // Y plate number of strips:200*0.050=10mm --> 100*0.100=10mm pitch= pitchY; ldrift = ldriftX; // because drift is in local coordinates which 90 degree rotated ( for correct timeNormalization & noiseRMS calculations) numStripsW = numStripsYW; // Y plate number of strips:200*0.050=10mm --> 100*0.100=10mm pitchW= pitchYW; } // X: if (xytype ==2) { numStrips = numStripsX; // X plate number of strips:400*0.050=20mm --> 200*0.100=20mm pitch= pitchX; ldrift = ldriftY; // because drift is in local coordinates which 90 degree rotated ( for correct timeNormalization & noiseRMS calculations) numStripsW = numStripsXW; // X plate number of strips:400*0.050=20mm --> 200*0.100=20mm pitchW= pitchXW; } // float noiseRMS = ENC*moduleThickness/Thick300; theHitDigitizerFP420 = new HitDigitizerFP420(moduleThickness,ldrift,ldriftY,ldriftX,thez420,thezD2,thezD3,verbosity); int numPixels = numStrips*numStripsW; theGNoiseFP420 = new GaussNoiseFP420(numPixels,noiseRMS,theThreshold,addNoisyPixels,verbosity); // theGNoiseFP420 = new GaussNoiseFP420(numStrips,noiseRMS,theThreshold,addNoisyPixels); theZSuppressFP420 = new ZeroSuppressFP420(conf_,noiseRMS/theElectronPerADC); thePileUpFP420 = new PileUpFP420(); theDConverterFP420 = new DigiConverterFP420(theElectronPerADC,verbosity); if(verbosity>0) std::cout << "FP420DigiMain end of constructor" << std::endl; }
FP420DigiMain::~FP420DigiMain | ( | ) |
Definition at line 142 of file FP420DigiMain.cc.
References gather_cfg::cout, theDConverterFP420, theGNoiseFP420, theHitDigitizerFP420, thePileUpFP420, theZSuppressFP420, and verbosity.
{ if(verbosity>0) { std::cout << "Destroying a FP420DigiMain" << std::endl; } delete theGNoiseFP420; delete theZSuppressFP420; delete theHitDigitizerFP420; delete thePileUpFP420; delete theDConverterFP420; }
void FP420DigiMain::fluctuateEloss | ( | int | particleId, |
float | momentum, | ||
float | eloss, | ||
float | length, | ||
int | NumberOfSegments, | ||
float | elossVector[] | ||
) | [private] |
void FP420DigiMain::push_digis | ( | const DigitalMapType & | dm, |
const HitToDigisMapType & | htd, | ||
const PileUpFP420::signal_map_type & | afterNoise | ||
) | [private] |
Definition at line 268 of file FP420DigiMain.cc.
References gather_cfg::cout, digis, i, ndigis, and verbosity.
Referenced by run().
{ // if(verbosity>0) { std::cout << " ****FP420DigiMain: push_digis start: do for loop dm.size()=" << dm.size() << std::endl; } digis.reserve(50); digis.clear(); // link_coll.clear(); for ( DigitalMapType::const_iterator i=dm.begin(); i!=dm.end(); i++) { // Load digis // push to digis the content of first and second words of HDigiFP420 vector for every strip pointer (*i) digis.push_back( HDigiFP420( (*i).first, (*i).second)); ndigis++; // very useful check: if(verbosity>0) { std::cout << " ****FP420DigiMain:push_digis: ndigis = " << ndigis << std::endl; std::cout << "push_digis: strip = " << (*i).first << " adc = " << (*i).second << std::endl; } } /* // // reworked to access the fraction of amplitude per simhit PSimHit // for ( HitToDigisMapType::const_iterator mi=htd.begin(); mi!=htd.end(); mi++) { #ifdef mydigidebug1 std::cout << " ****push_digis:first for: (*mi).first = " << (*mi).first << std::endl; std::cout << " if condition = " << (*((const_cast<DigitalMapType * >(&dm))))[(*mi).first] << std::endl; #endif // if ((*((const_cast<DigitalMapType * >(&dm))))[(*mi).first] != 0){ if ((*((const_cast<DigitalMapType * >(&dm)))).find((*mi).first) != (*((const_cast<DigitalMapType * >(&dm)))).end() ){ // // For each channel, sum up the signals from a simtrack // std::map<const PSimHit *, Amplitude> totalAmplitudePerSimHit; for (std::vector < std::pair < const PSimHit*, Amplitude > >::const_iterator simul = (*mi).second.begin() ; simul != (*mi).second.end(); simul ++){ #ifdef mydigidebug1 std::cout << " ****push_digis:inside last for: (*simul).second= " << (*simul).second << std::endl; #endif totalAmplitudePerSimHit[(*simul).first] += (*simul).second; } // for } // if } // for */ // reworked to access the fraction of amplitude per simhit for ( HitToDigisMapType::const_iterator mi=htd.begin(); mi!=htd.end(); mi++) { // if ((*((const_cast<DigitalMapType * >(&dm)))).find((*mi).first) != (*((const_cast<DigitalMapType * >(&dm)))).end() ){ // --- For each channel, sum up the signals from a simtrack // map<const PSimHit *, Amplitude> totalAmplitudePerSimHit; for (std::vector < std::pair < const PSimHit*, Amplitude > >::const_iterator simul = (*mi).second.begin() ; simul != (*mi).second.end(); simul ++){ totalAmplitudePerSimHit[(*simul).first] += (*simul).second; } /* //--- include the noise as well PileUpFP420::signal_map_type& temp1 = const_cast<PileUpFP420::signal_map_type&>(afterNoise); float totalAmplitude1 = temp1[(*mi).first]; //--- digisimlink for (std::map<const PSimHit *, Amplitude>::const_iterator iter = totalAmplitudePerSimHit.begin(); iter != totalAmplitudePerSimHit.end(); iter++){ float threshold = 0.; if (totalAmplitudePerSimHit[(*iter).first]/totalAmplitude1 >= threshold) { float fraction = totalAmplitudePerSimHit[(*iter).first]/totalAmplitude1; //Noise fluctuation could make fraction>1. Unphysical, set it by hand. if(fraction >1.) fraction = 1.; link_coll.push_back(StripDigiSimLink( (*mi).first, //channel ((*iter).first)->trackId(), //simhit fraction)); //fraction }//if }//for */ // }//if }//for // // // // // }
vector< HDigiFP420 > FP420DigiMain::run | ( | const std::vector< PSimHit > & | input, |
G4ThreeVector | bfield, | ||
unsigned int | iu | ||
) |
Definition at line 159 of file FP420DigiMain.cc.
References abs, PileUpFP420::add(), GaussNoiseFP420::addNoise(), DigiConverterFP420::convert(), gather_cfg::cout, PSimHit::detUnitId(), digis, PileUpFP420::dumpLink(), PileUpFP420::dumpSignal(), elossCut, PSimHit::energyLoss(), PSimHit::entryPoint(), PSimHit::exitPoint(), first, moduleThickness, noNoise, numStrips, numStripsW, PSimHit::pabs(), PSimHit::particleType(), pitch, pitchW, HitDigitizerFP420::processHit(), push_digis(), PileUpFP420::reset(), theApplyTofCut, theDConverterFP420, theGNoiseFP420, theHitDigitizerFP420, thePileUpFP420, theZSuppressFP420, PSimHit::tof(), tofCut, PSimHit::trackId(), verbosity, PV3DBase< T, PVType, FrameType >::x(), xytype, PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and ZeroSuppressFP420::zeroSuppress().
Referenced by cms::DigitizerFP420::produce().
{ /* int det, zside, sector, zmodule; // theFP420NumberingScheme->FP420NumberingScheme::unpackMYIndex(iu, rn0, pn0, sn0, det, zside, sector, zmodule); theFP420NumberingScheme->unpackMYIndex(iu, rn0, pn0, sn0, det, zside, sector, zmodule); */ thePileUpFP420->reset(); // unsigned int detID = det->globalId().rawId(); // unsigned int detID = 1; bool first = true; // main loop // // First: loop on the SimHits // std::vector<PSimHit>::const_iterator simHitIter = input.begin(); std::vector<PSimHit>::const_iterator simHitIterEnd = input.end(); for (;simHitIter != simHitIterEnd; ++simHitIter) { const PSimHit ihit = *simHitIter; if ( first ) { // detID = ihit.detUnitId(); first = false; } // main part here: double losenergy = ihit.energyLoss(); float tof = ihit.tof(); if(verbosity>1) { unsigned int unitID = ihit.detUnitId(); std::cout << " *******FP420DigiMain: intindex= " << iu << std::endl; std::cout << " tof= " << tof << " EnergyLoss= " << losenergy << " pabs= " << ihit.pabs() << std::endl; std::cout << " EntryLocalP x= " << ihit.entryPoint().x() << " EntryLocalP y= " << ihit.entryPoint().y() << std::endl; std::cout << " ExitLocalP x= " << ihit.exitPoint().x() << " ExitLocalP y= " << ihit.exitPoint().y() << std::endl; std::cout << " EntryLocalP z= " << ihit.entryPoint().z() << " ExitLocalP z= " << ihit.exitPoint().z() << std::endl; std::cout << " unitID= " << unitID << " xytype= " << xytype << " particleType= " << ihit.particleType() << " trackId= " << ihit.trackId() << std::endl; // std::cout << " det= " << det << " sector= " << sector << " zmodule= " << zmodule << std::endl; std::cout << " bfield= " << bfield << std::endl; } if(verbosity>0) { std::cout << " *******FP420DigiMain: theApplyTofCut= " << theApplyTofCut << std::endl; std::cout << " tof= " << tof << " EnergyLoss= " << losenergy << " pabs= " << ihit.pabs() << std::endl; std::cout << " particleType= " << ihit.particleType() << std::endl; } // // if ( ( !(theApplyTofCut) || (theApplyTofCut && tofCut < abs(tof) < (tofCut+200.)) ) && losenergy > elossCut) { if ( ( !(theApplyTofCut) || ( theApplyTofCut && abs(tof) > tofCut && abs(tof) < (tofCut+200.)) ) && losenergy > elossCut) { // if ( abs(tof) < tofCut && losenergy > elossCut) { // if ( losenergy>0) { if(verbosity>0) std::cout << " inside tof: OK " << std::endl; // xytype = 1 - Y strips; =2 - X strips; // HitDigitizerFP420::hit_map_type _temp = theHitDigitizerFP420->processHit(ihit,bfield,xytype,numStrips,pitch); HitDigitizerFP420::hit_map_type _temp = theHitDigitizerFP420->processHit(ihit,bfield,xytype,numStrips,pitch,numStripsW,pitchW,moduleThickness,verbosity); thePileUpFP420->add(_temp,ihit,verbosity); }// if else { // std::cout << " *******FP420DigiMain: ERROR??? losenergy = " << losenergy << std::endl; } // main part end (AZ) } //for // main loop end (AZ) PileUpFP420::signal_map_type theSignal = thePileUpFP420->dumpSignal(); PileUpFP420::HitToDigisMapType theLink = thePileUpFP420->dumpLink(); PileUpFP420::signal_map_type afterNoise; if (noNoise) { afterNoise = theSignal; } else { afterNoise = theGNoiseFP420->addNoise(theSignal); // add_noise(); } // if((pixelInefficiency>0) && (_signal.size()>0)) // pixel_inefficiency(); // Kill some pixels digis.clear(); // !!!!! push_digis(theZSuppressFP420->zeroSuppress(theDConverterFP420->convert(afterNoise),verbosity), theLink,afterNoise); return digis; // to HDigiFP420 }
std::vector<short int> FP420DigiMain::adcVec [private] |
Definition at line 54 of file FP420DigiMain.h.
bool FP420DigiMain::addNoisyPixels [private] |
Definition at line 82 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
double FP420DigiMain::appliedVoltage [private] |
Definition at line 103 of file FP420DigiMain.h.
double FP420DigiMain::chargeDistributionRMS [private] |
Definition at line 107 of file FP420DigiMain.h.
double FP420DigiMain::chargeMobility [private] |
Definition at line 104 of file FP420DigiMain.h.
float FP420DigiMain::ClusterWidth [private] |
Definition at line 67 of file FP420DigiMain.h.
edm::ParameterSet FP420DigiMain::conf_ [private] |
Definition at line 56 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
double FP420DigiMain::depletionVoltage [private] |
Definition at line 102 of file FP420DigiMain.h.
std::vector<HDigiFP420> FP420DigiMain::digis [private] |
Definition at line 202 of file FP420DigiMain.h.
Referenced by push_digis(), and run().
bool FP420DigiMain::doMissCalibrate [private] |
Definition at line 180 of file FP420DigiMain.h.
float FP420DigiMain::elossCut [private] |
Definition at line 85 of file FP420DigiMain.h.
Referenced by FP420DigiMain(), and run().
float FP420DigiMain::ENC [private] |
Definition at line 75 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
LandauFP420 FP420DigiMain::fluctuate [private] |
Definition at line 191 of file FP420DigiMain.h.
double FP420DigiMain::ldrift [private] |
Definition at line 98 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
double FP420DigiMain::ldriftX [private] |
Definition at line 96 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
double FP420DigiMain::ldriftY [private] |
Definition at line 97 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
float FP420DigiMain::moduleThickness [private] |
Definition at line 170 of file FP420DigiMain.h.
Referenced by FP420DigiMain(), and run().
int FP420DigiMain::ndigis [private] |
Definition at line 53 of file FP420DigiMain.h.
Referenced by FP420DigiMain(), and push_digis().
bool FP420DigiMain::noDiffusion [private] |
Definition at line 106 of file FP420DigiMain.h.
bool FP420DigiMain::noNoise [private] |
Definition at line 81 of file FP420DigiMain.h.
Referenced by FP420DigiMain(), and run().
int FP420DigiMain::NumberOfSegments [private] |
Definition at line 59 of file FP420DigiMain.h.
int FP420DigiMain::numStrips [private] |
Definition at line 164 of file FP420DigiMain.h.
Referenced by FP420DigiMain(), and run().
int FP420DigiMain::numStripsW [private] |
Definition at line 167 of file FP420DigiMain.h.
Referenced by FP420DigiMain(), and run().
int FP420DigiMain::numStripsX [private] |
Definition at line 162 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
int FP420DigiMain::numStripsXW [private] |
Definition at line 165 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
int FP420DigiMain::numStripsY [private] |
Definition at line 163 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
int FP420DigiMain::numStripsYW [private] |
Definition at line 166 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
double FP420DigiMain::pitch [private] |
Definition at line 91 of file FP420DigiMain.h.
Referenced by FP420DigiMain(), and run().
double FP420DigiMain::pitchW [private] |
Definition at line 94 of file FP420DigiMain.h.
Referenced by FP420DigiMain(), and run().
double FP420DigiMain::pitchX [private] |
Definition at line 89 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
double FP420DigiMain::pitchXW [private] |
Definition at line 92 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
double FP420DigiMain::pitchY [private] |
Definition at line 90 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
double FP420DigiMain::pitchYW [private] |
Definition at line 93 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
float FP420DigiMain::Sigma0 [private] |
Definition at line 63 of file FP420DigiMain.h.
std::vector<const PSimHit*> FP420DigiMain::ss [private] |
Definition at line 193 of file FP420DigiMain.h.
double FP420DigiMain::temperature [private] |
Definition at line 105 of file FP420DigiMain.h.
int FP420DigiMain::theAdcFullScale [private] |
Definition at line 76 of file FP420DigiMain.h.
bool FP420DigiMain::theApplyTofCut [private] |
Definition at line 83 of file FP420DigiMain.h.
Referenced by FP420DigiMain(), and run().
CDividerFP420* FP420DigiMain::theCDividerFP420 [private] |
Definition at line 130 of file FP420DigiMain.h.
Definition at line 120 of file FP420DigiMain.h.
Definition at line 158 of file FP420DigiMain.h.
Referenced by FP420DigiMain(), run(), and ~FP420DigiMain().
float FP420DigiMain::theElectronPerADC [private] |
Definition at line 71 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
Definition at line 172 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
float FP420DigiMain::theGainSmearing [private] |
Definition at line 181 of file FP420DigiMain.h.
GaussNoiseFP420* FP420DigiMain::theGNoiseFP420 [private] |
Definition at line 154 of file FP420DigiMain.h.
Referenced by FP420DigiMain(), run(), and ~FP420DigiMain().
Definition at line 156 of file FP420DigiMain.h.
Referenced by FP420DigiMain(), run(), and ~FP420DigiMain().
float FP420DigiMain::theNoiseInElectrons [private] |
Definition at line 77 of file FP420DigiMain.h.
GaussNoiseProducerFP420* FP420DigiMain::theNoiser [private] |
Definition at line 192 of file FP420DigiMain.h.
float FP420DigiMain::theOffsetSmearing [private] |
Definition at line 182 of file FP420DigiMain.h.
PileUpFP420* FP420DigiMain::thePileUpFP420 [private] |
Definition at line 155 of file FP420DigiMain.h.
Referenced by FP420DigiMain(), run(), and ~FP420DigiMain().
int FP420DigiMain::theStripsInChip [private] |
Definition at line 160 of file FP420DigiMain.h.
float FP420DigiMain::theStripThreshold [private] |
Definition at line 78 of file FP420DigiMain.h.
float FP420DigiMain::theStripThresholdInE [private] |
Definition at line 79 of file FP420DigiMain.h.
float FP420DigiMain::theThreshold [private] |
Definition at line 87 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
double FP420DigiMain::thez420 [private] |
Definition at line 72 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
double FP420DigiMain::thezD2 [private] |
Definition at line 73 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
double FP420DigiMain::thezD3 [private] |
Definition at line 74 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
Definition at line 157 of file FP420DigiMain.h.
Referenced by FP420DigiMain(), run(), and ~FP420DigiMain().
float FP420DigiMain::Thick300 [private] |
Definition at line 64 of file FP420DigiMain.h.
Referenced by FP420DigiMain().
double FP420DigiMain::tMax [private] |
Definition at line 188 of file FP420DigiMain.h.
double FP420DigiMain::tofCut [private] |
Definition at line 86 of file FP420DigiMain.h.
Referenced by FP420DigiMain(), and run().
int FP420DigiMain::verbosity [private] |
Definition at line 59 of file FP420DigiMain.h.
Referenced by FP420DigiMain(), push_digis(), run(), and ~FP420DigiMain().
int FP420DigiMain::xytype [private] |
Definition at line 59 of file FP420DigiMain.h.
Referenced by FP420DigiMain(), and run().