All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
SimDigital.cc
Go to the documentation of this file.
1 #include "SimDigital.h"
2 
3 #include <EVENT/LCCollection.h>
4 #include <EVENT/SimCalorimeterHit.h>
5 #include <IMPL/CalorimeterHitImpl.h>
6 #include <IMPL/LCCollectionVec.h>
7 #include <EVENT/MCParticle.h>
8 #include <IMPL/LCFlagImpl.h>
9 #include <IMPL/LCRelationImpl.h>
10 #include <marlin/Global.h>
11 #include <marlin/Exceptions.h>
12 
13 #include <EVENT/LCParameters.h>
14 #include <UTIL/CellIDDecoder.h>
15 #include <UTIL/CellIDEncoder.h>
16 
17 #include <iostream>
18 #include <string>
19 #include <algorithm>
20 
21 // ----- include for verbosity dependend logging ---------
22 #include "marlin/VerbosityLevels.h"
23 #include "CalorimeterHitType.h"
24 
25 #include <marlin/AIDAProcessor.h>
26 #include <AIDA/ITupleFactory.h>
27 #include <AIDA/ITuple.h>
28 
29 #include <DDSegmentation/BitField64.h>
30 #include <DDRec/CellIDPositionConverter.h>
31 #include <DD4hep/DetectorSelector.h>
32 
33 using namespace lcio ;
34 using namespace marlin ;
35 using namespace std;
36 
37 
39 
40 
42  : Processor("SimDigital") ,
43  chargeSpreaderParameters()
44 {
45  _description = "This processor creates SDHCAL digitized CalorimeterHits from SDHCAL SimCalorimeterHits" ;
46 
47 
48  std::vector<std::string> hcalCollections = { "HcalBarrelCollection" , "HcalEndCapRingsCollection" , "HcalEndCapsCollection" } ;
49  registerInputCollections( LCIO::SIMCALORIMETERHIT,
50  "inputHitCollections" ,
51  "Sim Calorimeter Hit Collections" ,
53  hcalCollections) ;
54 
55 
56  std::vector<std::string> outputHcalCollections = { "HCALBarrelDigi" , "HCALEndcapDigi" , "HCALOtherDigi" } ;
57  registerProcessorParameter( "outputHitCollections",
58  "output hit collection names",
60  outputHcalCollections) ;
61 
62  std::vector<std::string> outputRelCollections = {} ;
63  registerProcessorParameter( "outputRelationCollections",
64  "output hit relation Collection Names" ,
66  outputRelCollections ) ;
67 
68 
69  std::vector<float> hcalThresholds = {0.1f} ;
70  registerProcessorParameter("HCALThreshold" ,
71  "Threshold for HCAL Hits in pC" ,
73  hcalThresholds) ;
74 
75  registerProcessorParameter( "HCALCellSize" ,
76  "Cell size (mm) of HCAL, if it is equal or less than zero then the value is taken from dd4hep" ,
77  _cellSize ,
78  0.0f ) ;
79 
80 
81  registerProcessorParameter("EffMapOption" ,
82  "Step efficiency correction method : should be Uniform" ,
84  std::string("Uniform") ) ;
85 
86  registerProcessorParameter("EffMapConstantValue",
87  "Value of the constant term for efficiency correction if EffMapOption==Uniform",
89  0.97f) ;
90 
91  registerProcessorParameter("EffMapFile" ,
92  "Efficiency map file" ,
93  effMapFile ,
94  std::string("")) ;
95 
96 
97  //charge spreader parameters
98  registerProcessorParameter("SpreaderMapFile",
99  "Charge spreader map file",
101  std::string("")) ;
102 
103  registerProcessorParameter( "functionRange" ,
104  "maximal distance (in mm) at which a step can induce charge using the 2D function defined with functionFormula or when using ChargeSplitterOption==Erf",
106  30.0f ) ;
107 
108 
109  registerProcessorParameter( "RPC_PadSeparation",
110  "distance in mm between two RPC pads : used if ChargeSplitterOption==Function or Erf",
112  0.0f ) ;
113 
114  std::vector<float> erfWidth = {2} ;
115  registerProcessorParameter( "erfWidth",
116  "Width values for the different Erf functions",
118  erfWidth ) ;
119 
120  std::vector<float> erfWeigth = {1} ;
121  registerProcessorParameter( "erfWeigth",
122  "Weigth for the different Erf functions",
124  erfWeigth ) ;
125 
126 
127  registerProcessorParameter( "ChargeSplitterd",
128  "d parameter for exact splitter",
130  1.0f ) ;
131 
132  registerProcessorParameter( "ChargeSplitterOption",
133  "Define the charge splitter method. Possible option : Erf , Exact",
135  std::string("Erf") ) ;
136 
137 
138 
139 
140  registerProcessorParameter( "CellIDEncodingStringType",
141  "The type of the encoding, LCGEO or PROTO",
143  std::string("LCGEO")) ;
144 
145 
146 
147  registerProcessorParameter("doThresholds",
148  "Replace analog hit energy by value given in CalibrHCAL according to thresholds given in HCALThreshold",
150  true) ;
151 
152 
153  registerProcessorParameter( "PolyaOption" ,
154  "Uniform polya or different polya per Asic",
155  polyaOption,
156  std::string("Uniform") ) ;
157 
158  registerProcessorParameter( "PolyaMapFile" ,
159  "Polya map file",
160  polyaMapFile,
161  std::string("") ) ;
162 
163  registerProcessorParameter( "PolyaRandomSeed",
164  "The seed of the polya function",
166  1 ) ;
167 
168  registerProcessorParameter( "PolyaAverageCharge" ,
169  "Parameter for the Polya distribution used to simulate the induced charge distribution : mean of the distribution",
170  polyaQbar ,
171  1.6f ) ;
172 
173  registerProcessorParameter( "PolyaWidthParameter" ,
174  "Parameter for the Polya distribution used to simulate the induced charge distribution : related to the distribution width ",
175  polyaTheta ,
176  16.3f ) ;
177 
178 
179  registerProcessorParameter( "GasGapWidth" ,
180  "Width of the RPC gas gap",
181  _gasGapWidth ,
182  1.2f ) ;
183 
184 
185 
186  registerProcessorParameter( "LinkSteps" ,
187  "Parameter for angle correction",
188  _linkSteps ,
189  false ) ;
190 
191 
192  registerProcessorParameter( "AngleCorrectionPower" ,
193  "Parameter for angle correction",
194  _angleCorrPow ,
195  0.4f ) ;
196 
197  registerProcessorParameter( "TimeCut" ,
198  "Time cut",
199  timeCut ,
200  std::numeric_limits<double>::max() ) ;
201 
202  registerProcessorParameter( "StepLengthCut" ,
203  "Step length cut",
204  stepLengthCut ,
205  -1.0 ) ;
206 
207 
208 
209 
210 
211  registerProcessorParameter( "StepCellCenterMaxDistanceLayerDirection",
212  "Maximum distance (mm) between the Geant4 step position and the cell center, in the RPC width direction, to keep a step for digitization",
214  0.0005f ) ;
215 
216  registerProcessorParameter( "StepsMinDistanceRPCplaneDirection",
217  "Minimum distance (mm) between 2 Geant4 steps, in the RPC plane, to keep the 2 steps",
219  0.5f ) ;
220 
221  registerProcessorParameter( "KeepAtLeastOneStep",
222  "if true, ensure that each hit will keep at least one step for digitisation independatly of filtering conditions (StepCellCenterMaxDistanceLayerDirection)",
224  true ) ;
225 }
226 
228 {
229  printParameters() ;
230  // check that number of input and output collections names are the same
231  assert ( _outputCollections.size() == _inputCollections.size() ) ;
232  assert ( _outputRelCollections.size() == _inputCollections.size() ) ;
233  assert ( _encodingType == std::string("LCGEO") || _encodingType == std::string("PROTO") ) ;
234 
235  //init charge inducer
236  if ( polyaOption == std::string("Uniform") )
238  else if ( polyaOption == std::string("PerAsic") )
240  else
241  throw ParseException( chargeSpreaderOption + std::string(" option for charge inducing is not available ") ) ;
242 
243  chargeInducer->setSeed(static_cast<unsigned int>(_polyaRandomSeed) ) ;
244  srand( static_cast<unsigned int>(_polyaRandomSeed) ) ;
245 
246 
247  //init charge spreader
248  if (chargeSpreaderOption == "Erf")
250  else if (chargeSpreaderOption == "Exact")
252  else if (chargeSpreaderOption == "ExactPerAsic")
254  else
255  throw ParseException( chargeSpreaderOption + std::string(" option for charge splitting is not available ") ) ;
256 
258  chargeSpreader->init() ;
259 
260 
261  //init efficiency manager
262  if (efficiencyOption == "Uniform")
264  else if (efficiencyOption == "PerAsic")
266  else
267  throw ParseException( efficiencyOption + std::string(" option for efficiency correction is not available") ) ;
268 
269 
270 
271  //assure SDHCAL _thresholdHcal are in increasing order
272  std::sort( _thresholdHcal.begin() , _thresholdHcal.end() ) ;
273 
274  //book tuples
275  _debugTupleStepFilter = AIDAProcessor::tupleFactory( this )->create("SimDigitalStepDebug",
276  "SimDigital_StepDebug",
277  "int filterlevel, float stepTime,deltaI,deltaJ,deltaLayer,minIJdist,length,charge");
278  streamlog_out(DEBUG) << "Tuple for step debug has been initialized to " << _debugTupleStepFilter << std::endl;
279  streamlog_out(DEBUG) << "it has " << _debugTupleStepFilter->columns() << " columns" <<std::endl;
280 
281 
282  _tupleStepFilter = AIDAProcessor::tupleFactory( this )->create("SimDigitalStepStat",
283  "SimDigital_StepStat",
284  "int allsteps, absZfiltered, IJdistancefiltered");
285  streamlog_out(DEBUG) << "Tuple for step stat has been initialized to " << _tupleStepFilter << std::endl;
286  streamlog_out(DEBUG) << "it has " << _tupleStepFilter->columns() << " columns" <<std::endl;
287 
288 
289  _tupleCollection = AIDAProcessor::tupleFactory( this )->create("CollectionStat",
290  "Collection_statistics",
291  "int NsimHit, NrecoHit, N1, N2, N3");
292  streamlog_out(DEBUG) << "Tuple for collection stat has been initialized to " << _tupleCollection << std::endl;
293  streamlog_out(DEBUG) << "it has " << _tupleCollection->columns() << " columns" <<std::endl;
294 
295  _histoCellCharge = AIDAProcessor::histogramFactory( this )->createHistogram1D("CellCharge","CellCharge",10000,0,100) ;
296 
297  //flags
298  flag.setBit(LCIO::CHBIT_LONG) ;
299  flag.setBit(LCIO::RCHBIT_TIME) ;
300  flagRel.setBit(LCIO::LCREL_WEIGHTED) ;
301 }
302 
303 void SimDigital::removeAdjacentStep(std::vector<StepAndCharge>& vec)
304 {
305  if ( vec.size() == 0 )
306  return ;
307  std::vector<StepAndCharge>::iterator first = vec.begin() ;
308  std::vector<StepAndCharge>::iterator lasttobekept = vec.end() ;
309  lasttobekept-- ;
310 
311  while (int(first-lasttobekept)<0)
312  {
313  std::vector<StepAndCharge>::iterator second=first;
314  second++;
315  while (int(second-lasttobekept) < 0)
316  {
317  if ( ((*first).step-(*second).step).perp() > _minXYdistanceBetweenStep ) // do nothing
318  second++;
319  else //second is too close of first : second should be removed so put it at the end
320  {
321  std::iter_swap(second,lasttobekept);
322  lasttobekept--;
323  }
324  }
325  if ( ((*first).step-(*lasttobekept).step).perp() <= _minXYdistanceBetweenStep )
326  lasttobekept--;
327  first++;
328  }
329  std::vector<StepAndCharge>::iterator firstToremove=lasttobekept;
330  firstToremove++;
331  if (_keepAtLeastOneStep && firstToremove==vec.begin())
332  firstToremove++;
333  vec.erase(firstToremove,vec.end());
334 }
335 
336 
337 void SimDigital::fillTupleStep(const std::vector<StepAndCharge>& vec,int level)
338 {
339  _tupleStepFilter->fill(level,int(vec.size()));
340  for (std::vector<StepAndCharge>::const_iterator it=vec.begin(); it != vec.end(); it++)
341  {
342  _debugTupleStepFilter->fill(0,level);
343  _debugTupleStepFilter->fill(1,it->time) ;
344  _debugTupleStepFilter->fill(2,it->step.x()) ;
345  _debugTupleStepFilter->fill(3,it->step.y()) ;
346  _debugTupleStepFilter->fill(4,it->step.z()) ;
347  float minDist=20000;
348  for (std::vector<StepAndCharge>::const_iterator itB=vec.begin(); itB != vec.end(); itB++)
349  {
350  if (itB == it)
351  continue ;
352  float dist = ( (it->step)-(itB->step) ).perp() ;
353  if (dist < minDist)
354  minDist=dist ;
355  }
356  _debugTupleStepFilter->fill(5,minDist);
357  _debugTupleStepFilter->fill(6,it->stepLength) ;
358  _debugTupleStepFilter->fill(7,it->charge) ;
359  _debugTupleStepFilter->addRow() ;
360  }
361 }
362 
363 
365 {
366  cellIDHitMap myHitMap ;
367 
368  int numElements = col->getNumberOfElements() ;
369 
370  for (int j = 0 ; j < numElements ; ++j )
371  {
372  SimCalorimeterHit* hit = dynamic_cast<SimCalorimeterHit*>( col->getElementAt( j ) ) ;
373 
374  std::vector<StepAndCharge> steps ;
375 
376  steps = aGeomCellId->decode(hit , _linkSteps) ;
377 
378  fillTupleStep(steps,0) ;
379 
380  float cellSize = aGeomCellId->getCellSize() ;
381  chargeSpreader->newHit(cellSize) ;
382 
383 
384  auto timeGreaterThan = [&](const StepAndCharge& v) -> bool { return std::fabs( v.time ) > timeCut ; } ;
385  std::vector<StepAndCharge>::iterator remPos = std::remove_if(steps.begin() , steps.end() , timeGreaterThan ) ;
386  steps.erase( remPos , steps.end() ) ;
387  fillTupleStep(steps,1) ;
388 
389 
390  auto stepSmallerThan = [&](const StepAndCharge& v) -> bool { return v.stepLength < stepLengthCut ; } ;
391  remPos = std::remove_if( steps.begin() , steps.end() , stepSmallerThan ) ;
392  steps.erase( remPos , steps.end() ) ;
393 
394 
395  fillTupleStep(steps,2) ;
396 
397  auto absZGreaterThan = [&](const StepAndCharge& v) -> bool { return std::abs( v.step.z() ) > _absZstepFilter ; } ;
398  remPos = std::remove_if(steps.begin() , steps.end() , absZGreaterThan ) ;
399 
400  if (steps.size() > 0 &&_keepAtLeastOneStep && remPos == steps.begin() )
401  remPos++ ;
402  steps.erase( remPos , steps.end() ) ;
403 
404  float eff = efficiency->getEfficiency(aGeomCellId) ;
405  auto randomGreater = [eff](const StepAndCharge&) -> bool { return static_cast<double>(rand())/RAND_MAX > eff ; } ;
406  steps.erase( std::remove_if(steps.begin() , steps.end() , randomGreater ) , steps.end() ) ;
407  fillTupleStep(steps,3) ;
408 
409 
410  float invGasGapWidth = 1.f/_gasGapWidth ;
411  for ( auto& itstep : steps )
412  {
413  float angleCorr = 1 ;
414  if ( itstep.stepLength*invGasGapWidth > 1 )
415  angleCorr = std::pow( itstep.stepLength*invGasGapWidth , _angleCorrPow ) ;
416 
417  itstep.charge = chargeInducer->getCharge(aGeomCellId)*angleCorr ;
418 
419  streamlog_out( DEBUG ) << "step at : " << itstep.step << "\t with a charge of : " << itstep.charge << std::endl ;
420  }
421 
422 
423  auto sortStepWithCharge = [](const StepAndCharge& s1 , const StepAndCharge& s2) -> bool { return s1.charge > s2.charge ; } ;
424  std::sort(steps.begin(), steps.end(), sortStepWithCharge ) ;
425 
426  streamlog_out( DEBUG ) << "sim hit at " << hit << std::endl ;
427  if (streamlog_level(DEBUG) )
428  {
429  for(std::vector<StepAndCharge>::iterator it=steps.begin(); it!=steps.end(); ++it)
430  streamlog_out( DEBUG ) << "step at : " << (*it).step << "\t with a charge of : " << (*it).charge << std::endl;
431 
432  }
433 
434  removeAdjacentStep(steps) ;
435  fillTupleStep(steps,4) ;
436  _tupleStepFilter->addRow() ;
437 
438  float time = std::numeric_limits<float>::max() ;
439  for ( const auto& step : steps )
440  time = std::min(time , step.time) ;
441 
442 
443  for ( const StepAndCharge& itstep : steps )
444  chargeSpreader->addCharge( itstep.charge , static_cast<float>(itstep.step.x()) , static_cast<float>(itstep.step.y()) , aGeomCellId ) ;
445 
446 
447  for ( const std::pair<ChargeSpreader::I_J_Coordinates,float>& it : chargeSpreader->getChargeMap() )
448  {
449  if (it.second >= 0)
450  {
451  std::unique_ptr<CalorimeterHitImpl> tmp = aGeomCellId->encode(it.first.first , it.first.second) ;
452 
453  if (tmp == nullptr)
454  continue ;
455 
456  dd4hep::long64 index = tmp->getCellID1() ;
457  index = index << 32 ;
458  index += tmp->getCellID0() ;
459 
460  if ( myHitMap.find(index) == myHitMap.end() ) //create hit
461  {
462  hitMemory& toto = myHitMap[index] ;
463  toto.ahit = std::move(tmp) ;
464  toto.ahit->setEnergy(0) ;
465  toto.ahit->setTime(time) ;
466  }
467 
468  hitMemory& calhitMem = myHitMap.at(index) ;
469 
470  if (calhitMem.maxEnergydueToHit < it.second)
471  {
472  calhitMem.rawHit = j ;
473  calhitMem.maxEnergydueToHit = it.second ;
474  }
475 
476  calhitMem.ahit->setEnergy( calhitMem.ahit->getEnergy() + it.second ) ;
477  calhitMem.relatedHits.insert(j) ;
478  }
479  else
480  {
481  streamlog_out(ERROR) << "BUG in charge splitter, got a non positive charge : " << it.second << std::endl ;
482  }
483  } //loop on added hits for this hit
484 
485  } // end of for (int j(0); j < numElements; ++j) //loop on elements in collection
486 
487  for( const auto& it : myHitMap )
488  _hitCharge.push_back( it.second.ahit->getEnergy() ) ;
489 
490  return myHitMap ;
491 }
492 
493 
494 void SimDigital::removeHitsBelowThreshold(cellIDHitMap& myHitMap, float threshold)
495 {
496  for ( auto it = myHitMap.cbegin() ; it != myHitMap.cend() ; )
497  {
498  if ( (it->second).ahit->getEnergy() < threshold )
499  it = myHitMap.erase(it) ;
500  else
501  ++it ;
502  }
503 }
504 
505 
507 {
508  for (cellIDHitMap::iterator it = myHitMap.begin() ; it != myHitMap.end() ; it++)
509  {
510  hitMemory& currentHitMem = it->second ;
511  float hitCharge = currentHitMem.ahit->getEnergy() ;
512 
513  unsigned int iThr = 0 ;
514  for ( unsigned int i = 0 ; i < _thresholdHcal.size() ; ++i )
515  {
516  if ( hitCharge >= _thresholdHcal.at(i) )
517  iThr = i ;
518  }
519 
520  if (iThr == 0)
521  _counters["N1"]++ ;
522  if (iThr == 1)
523  _counters["N2"]++ ;
524  if (iThr == 2)
525  _counters["N3"]++ ;
526 
527  currentHitMem.ahit->setEnergy( static_cast<float>( iThr+1 ) ) ;
528  }
529 }
530 
531 void SimDigital::processCollection(LCCollection* inputCol , LCCollectionVec*& outputCol , LCCollectionVec*& outputRelCol , CHT::Layout layout)
532 {
533  outputCol = new LCCollectionVec(LCIO::CALORIMETERHIT) ;
534  outputRelCol = new LCCollectionVec(LCIO::LCRELATION) ;
535 
536  outputCol->setFlag(flag.getFlag()) ;
537 
538  outputRelCol->setFlag(flagRel.getFlag()) ;
539  outputRelCol->parameters().setValue("FromType" , LCIO::CALORIMETERHIT ) ;
540  outputRelCol->parameters().setValue("ToType" , LCIO::SIMCALORIMETERHIT ) ;
541 
542  SimDigitalGeomCellId* geomCellId = nullptr ;
543 
544  if ( _encodingType == std::string("LCGEO") )
545  geomCellId = new SimDigitalGeomCellIdLCGEO(inputCol,outputCol) ;
546  else if ( _encodingType == std::string("PROTO") )
547  geomCellId = new SimDigitalGeomCellIdPROTO(inputCol,outputCol) ;
548 
549  geomCellId->setCellSize(_cellSize) ;
550 
551  geomCellId->setLayerLayout(layout) ;
552  cellIDHitMap myHitMap = createPotentialOutputHits(inputCol , geomCellId) ;
553 
554  removeHitsBelowThreshold(myHitMap , _thresholdHcal.at(0) ) ;
555 
556  if (_doThresholds)
557  applyThresholds(myHitMap) ;
558 
559  //Store element to output collection
560  for (cellIDHitMap::iterator it = myHitMap.begin() ; it != myHitMap.end() ; it++)
561  {
562  hitMemory& currentHitMem = it->second ;
563  if (currentHitMem.rawHit != -1)
564  {
565  streamlog_out(DEBUG) << " rawHit= " << currentHitMem.rawHit << std::endl ;
566  SimCalorimeterHit* hitraw = dynamic_cast<SimCalorimeterHit*>( inputCol->getElementAt( currentHitMem.rawHit ) ) ;
567  currentHitMem.ahit->setRawHit(hitraw) ;
568  }
569 
570  auto caloHit = currentHitMem.ahit.release() ;
571  outputCol->addElement(caloHit) ;
572 
573  //put only one relation with the SimCalorimeterHit which contributes most
574  SimCalorimeterHit* hit = dynamic_cast<SimCalorimeterHit*>( inputCol->getElementAt( currentHitMem.rawHit ) ) ;
575  LCRelationImpl* rel = new LCRelationImpl(caloHit , hit , 1.0) ;
576  outputRelCol->addElement( rel ) ;
577 
578  } //end of loop on myHitMap
579 
580  delete geomCellId ;
581 }
582 
583 void SimDigital::processEvent( LCEvent* evt )
584 {
585  if( isFirstEvent() )
587 
588  _counters["|ALL"]++;
589  _counters["NSim"]=0;
590  _counters["NReco"]=0;
591  _counters["N1"]=0;
592  _counters["N2"]=0;
593  _counters["N3"]=0;
594 
595  geneMap.clear() ;
596  _hitCharge.clear() ;
597 
598  for (unsigned int i(0) ; i < _inputCollections.size() ; ++i)
599  {
600  try
601  {
602  std::string inputColName = _inputCollections.at(i) ;
603  std::string outputColName = _outputCollections.at(i) ;
604  std::string outputRelColName = _outputRelCollections.at(i) ;
605 
606  LCCollection* inputCol = evt->getCollection( inputColName.c_str() ) ;
607  _counters["NSim"] += inputCol->getNumberOfElements() ;
608  CHT::Layout layout = layoutFromString( inputColName ) ;
609 
610  LCCollectionVec* outputCol = nullptr ;
611  LCCollectionVec* outputRelCol = nullptr ;
612 
613  processCollection(inputCol , outputCol , outputRelCol , layout) ;
614 
615  _counters["NReco"] += outputCol->getNumberOfElements() ;
616 
617  evt->addCollection(outputCol , outputColName.c_str()) ;
618  evt->addCollection(outputRelCol , outputRelColName.c_str()) ;
619  }
620  catch(DataNotAvailableException& )
621  {
622  }
623  }
624 
625  _tupleCollection->fill(0,_counters["NSim"]);
626  _tupleCollection->fill(1,_counters["NReco"]);
627  _tupleCollection->fill(2,_counters["N1"]);
628  _tupleCollection->fill(3,_counters["N2"]);
629  _tupleCollection->fill(4,_counters["N3"]);
630  _tupleCollection->addRow();
631 
632  for( const auto& it : _hitCharge)
633  _histoCellCharge->fill(it) ;
634 
635  streamlog_out(MESSAGE) << "have processed " << _counters["|ALL"] << " events" << std::endl;
636 }
637 
float _angleCorrPow
Definition: SimDigital.h:178
static void bookTuples(const marlin::Processor *proc)
LCFlagImpl flagRel
Definition: SimDigital.h:153
virtual void addCharge(float charge, float posI, float posJ, SimDigitalGeomCellId *)
LCFlagImpl flag
Definition: SimDigital.h:152
std::string efficiencyOption
Definition: SimDigital.h:186
AIDA::ITuple * _tupleCollection
Definition: SimDigital.h:197
void processCollection(LCCollection *inputCol, LCCollectionVec *&outputCol, LCCollectionVec *&outputRelCol, CHT::Layout layout)
Definition: SimDigital.cc:531
std::vector< float > _thresholdHcal
Definition: SimDigital.h:156
AIDA::ITuple * _tupleStepFilter
Definition: SimDigital.h:196
virtual void init()
Called at the begin of the job before anything is read.
Definition: SimDigital.cc:227
virtual float getCellSize()=0
std::string polyaOption
Definition: SimDigital.h:171
std::string chargeSpreaderOption
Definition: SimDigital.h:166
float polyaQbar
Definition: SimDigital.h:173
AIDA::IHistogram1D * _histoCellCharge
Definition: SimDigital.h:199
std::unique_ptr< CalorimeterHitImpl > ahit
Definition: SimDigital.h:126
virtual void init()=0
std::vector< float > erfWeigth
double stepLengthCut
Definition: SimDigital.h:181
virtual float getEfficiency(SimDigitalGeomCellId *cellID)=0
void removeHitsBelowThreshold(cellIDHitMap &myHitMap, float threshold)
Definition: SimDigital.cc:494
std::map< std::string, int > _counters
Definition: SimDigital.h:155
std::set< int > relatedHits
Definition: SimDigital.h:128
cellIDHitMap createPotentialOutputHits(LCCollection *col, SimDigitalGeomCellId *aGeomCellId)
Definition: SimDigital.cc:364
std::vector< StepAndCharge > decode(SimCalorimeterHit *hit, bool link)
std::string spreaderMapFile
Definition: SimDigital.h:167
float polyaTheta
Definition: SimDigital.h:174
bool _linkSteps
Definition: SimDigital.h:183
std::vector< double > _hitCharge
Definition: SimDigital.h:158
ChargeInducer * chargeInducer
Definition: SimDigital.h:175
std::map< dd4hep::long64, hitMemory > cellIDHitMap
Definition: SimDigital.h:136
std::vector< float > erfWidth
EfficiencyManager * efficiency
Definition: SimDigital.h:188
void applyThresholds(cellIDHitMap &myHitMap)
Definition: SimDigital.cc:506
ChargeSpreader * chargeSpreader
Definition: SimDigital.h:169
SimDigital aSimDigital
Definition: SimDigital.cc:38
AIDA::ITuple * _debugTupleStepFilter
Definition: SimDigital.h:195
void newHit(float cellSize_)
std::vector< std::string > _outputCollections
Definition: SimDigital.h:149
bool _doThresholds
Definition: SimDigital.h:184
float _constEffMapValue
Definition: SimDigital.h:189
void setSeed(unsigned int value)
float _cellSize
Definition: SimDigital.h:162
float charge
Definition: SimDigital.h:71
bool _keepAtLeastOneStep
Definition: SimDigital.h:193
std::string effMapFile
Definition: SimDigital.h:187
float _absZstepFilter
Definition: SimDigital.h:191
virtual void setLayerLayout(CHT::Layout layout)=0
std::vector< LCCollection * > LCCollectionVec
Definition: SiStripClus.h:55
float _gasGapWidth
Definition: SimDigital.h:163
virtual std::unique_ptr< CalorimeterHitImpl > encode(int delta_I, int delta_J)=0
std::map< dd4hep::long64, std::vector< LCGenericObject * > > geneMap
Definition: SimDigital.h:160
std::string _encodingType
Definition: SimDigital.h:201
double timeCut
Definition: SimDigital.h:180
int _polyaRandomSeed
Definition: SimDigital.h:176
std::vector< std::string > _outputRelCollections
Definition: SimDigital.h:150
float _minXYdistanceBetweenStep
Definition: SimDigital.h:192
virtual void processEvent(LCEvent *evt)
Called for every event - the working horse.
Definition: SimDigital.cc:583
virtual void setParameters(ChargeSpreaderParameters param)
const std::map< I_J_Coordinates, float > & getChargeMap() const
void setCellSize(float size)
ChargeSpreaderParameters chargeSpreaderParameters
Definition: SimDigital.h:168
std::string polyaMapFile
Definition: SimDigital.h:172
std::vector< std::string > _inputCollections
Definition: SimDigital.h:147
void fillTupleStep(const std::vector< StepAndCharge > &vec, int level)
Definition: SimDigital.cc:337
virtual float getCharge(SimDigitalGeomCellId *cellID)=0
void removeAdjacentStep(std::vector< StepAndCharge > &vec)
Definition: SimDigital.cc:303