ATLAS Offline Software
PixelFastDigitizationTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // PixelFastDigitizationTool.cxx
7 // Implementation file for class PixelFastDigitizationTool
9 
10 // Pixel digitization includes
12 #include "PixelConditionsData/ChargeCalibParameters.h" //for Thresholds
13 
14 // Det Descr
15 #include "Identifier/Identifier.h"
16 
22 
23 // Random numbers
25 #include "CLHEP/Random/RandGaussZiggurat.h"
26 #include "CLHEP/Random/RandFlat.h"
27 #include "CLHEP/Random/RandLandau.h"
28 
29 // DataHandle
30 #include "StoreGate/DataHandle.h"
31 
32 // Pile-up
33 
35 
36 // Fatras
45 
47 #include "AtlasHepMC/GenParticle.h"
48 
49 //Package For New Tracking:
50 // Amg includes
53 // Trk includes
54 
57 
63 
64 
65 using namespace InDetDD;
66 using namespace InDet;
67 
68 // Constructor with parameters:
69 PixelFastDigitizationTool::PixelFastDigitizationTool(const std::string &type, const std::string &name,
70  const IInterface* parent):
71 
73 {
74 }
75 
77  if(m_pixelClusterMap) {
78  delete m_pixelClusterMap;
79  }
80 }
81 
82 // Initialize method:
84 {
85 
86  ATH_MSG_DEBUG ( "PixelDigitizationTool::initialize()" );
87 
88  ATH_CHECK(m_pixelReadout.retrieve());
92 
93  //locate the AtRndmGenSvc and initialize our local ptr
94  if (!m_rndmSvc.retrieve().isSuccess())
95  {
96  ATH_MSG_ERROR ( "Could not find given RndmSvc" );
97  return StatusCode::FAILURE;
98  }
99 
100  if (detStore()->retrieve(m_pixel_ID, "PixelID").isFailure()) {
101  ATH_MSG_ERROR ( "Could not get Pixel ID helper" );
102  return StatusCode::FAILURE;
103  }
104 
105  if (m_inputObjectName.empty())
106  {
107  ATH_MSG_FATAL ( "Property InputObjectName not set !" );
108  return StatusCode::FAILURE;
109  }
110  else
111  {
112  ATH_MSG_DEBUG ( "Input objects: '" << m_inputObjectName << "'" );
113  }
114 
115  // retrieve the offline cluster maker : for pixel and/or sct
116  if ( m_pixUseClusterMaker) {
117  if (m_clusterMaker.retrieve().isFailure()){
118  ATH_MSG_WARNING( "Could not retrieve " << m_clusterMaker );
119  ATH_MSG_WARNING( "-> Switching to simplified cluster creation!" );
120  m_pixUseClusterMaker = false;
121  m_clusterMaker.disable();
122  }
123  } else {
124  m_clusterMaker.disable();
125  }
126 
127  if (m_pixModuleDistortion) {
129  }
130 
131  //locate the PileUpMergeSvc and initialize our local ptr
132  if (!m_mergeSvc.retrieve().isSuccess()) {
133  ATH_MSG_ERROR ( "Could not find PileUpMergeSvc" );
134  return StatusCode::FAILURE;
135  }
136 
137 
138  // get the InDet::PixelGangedAmbiguitiesFinder
139  if ( m_gangedAmbiguitiesFinder.retrieve().isFailure() ) {
140  ATH_MSG_FATAL( m_gangedAmbiguitiesFinder.propertyName() << ": Failed to retrieve tool " << m_gangedAmbiguitiesFinder.type() );
141  return StatusCode::FAILURE;
142  } else {
143  ATH_MSG_DEBUG ( m_gangedAmbiguitiesFinder.propertyName() << ": Retrieved tool " << m_gangedAmbiguitiesFinder.type() );
144  }
145 
146  ATH_CHECK(m_lorentzAngleTool.retrieve());
147 
148  return StatusCode::SUCCESS;
149 }
150 
151 
152 
153 StatusCode PixelFastDigitizationTool::prepareEvent(const EventContext& /*ctx*/, unsigned int)
154 {
155 
156  m_siHitCollList.clear();
159  return StatusCode::SUCCESS;
160 }
161 
162 
164  SubEventIterator bSubEvents,
165  SubEventIterator eSubEvents)
166 {
167  //decide if this event will be processed depending on HardScatterSplittingMode & bunchXing
168  if (m_HardScatterSplittingMode == 2 && !m_HardScatterSplittingSkipper ) { m_HardScatterSplittingSkipper = true; return StatusCode::SUCCESS; }
169  if (m_HardScatterSplittingMode == 1 && m_HardScatterSplittingSkipper ) { return StatusCode::SUCCESS; }
171 
172  using TimedHitCollList = PileUpMergeSvc::TimedList<SiHitCollection>::type;
173  TimedHitCollList hitCollList;
174 
175  if (!(m_mergeSvc->retrieveSubSetEvtData(m_inputObjectName.value(), hitCollList, bunchXing,
176  bSubEvents, eSubEvents).isSuccess()) &&
177  hitCollList.empty()) {
178  ATH_MSG_ERROR("Could not fill TimedHitCollList");
179  return StatusCode::FAILURE;
180  } else {
181  ATH_MSG_VERBOSE(hitCollList.size() << " SiHitCollections with key " <<
182  m_inputObjectName << " found");
183  }
184 
185  TimedHitCollList::iterator iColl(hitCollList.begin());
186  TimedHitCollList::iterator endColl(hitCollList.end());
187 
188  for( ; iColl != endColl; ++iColl) {
189  SiHitCollection *siHitColl = new SiHitCollection(*iColl->second);
190  PileUpTimeEventIndex timeIndex(iColl->first);
191  ATH_MSG_DEBUG("SiHitCollection found with " << siHitColl->size() <<
192  " hits");
193  ATH_MSG_VERBOSE("time index info. time: " << timeIndex.time()
194  << " index: " << timeIndex.index()
195  << " type: " << timeIndex.type());
196  m_thpcsi->insert(timeIndex, siHitColl);
197  m_siHitCollList.push_back(siHitColl);
198  }
199 
200  return StatusCode::SUCCESS;
201 }
202 
203 
205 
207 
209  ATH_MSG_FATAL( "[ --- ] Could not create PixelClusterContainer");
210  return StatusCode::FAILURE;
211  }
212 
213  InDet::SiClusterContainer* symSiContainer=nullptr;
214 
215  // --------------------------------------
216  // Pixel Cluster container registration
217  m_pixelClusterContainer->cleanup();
218  if ((evtStore()->record(m_pixelClusterContainer, m_pixel_SiClustersName)).isFailure()) {
219  ATH_MSG_FATAL("[ hitproc ] Error while registering PixelCluster container");
220  return StatusCode::FAILURE;
221  }
222 
223  // symlink the Pixel Cluster Container
224  if ((evtStore()->symLink(m_pixelClusterContainer,symSiContainer)).isFailure()) {
225  ATH_MSG_FATAL( "[ --- ] PixelClusterContainer could not be symlinked to SiClusterContainter in StoreGate !" );
226  return StatusCode::FAILURE;
227  } else {
228  ATH_MSG_DEBUG( "[ hitproc ] PixelClusterContainer symlinked to SiClusterContainer in StoreGate" );
229  }
230 
231  // truth info
232 
234 
235  if ((evtStore()->contains<PRD_MultiTruthCollection>(m_prdTruthNamePixel))){
236  if((evtStore()->retrieve(m_pixPrdTruth, m_prdTruthNamePixel)).isFailure()){
237  ATH_MSG_FATAL("Could not retrieve collection " << m_prdTruthNamePixel);
238  return StatusCode::FAILURE;
239  }
240  }else{
241  if((evtStore()->record(m_pixPrdTruth, m_prdTruthNamePixel)).isFailure()){
242  ATH_MSG_FATAL("Could not record collection " << m_prdTruthNamePixel);
243  return StatusCode::FAILURE;
244  }
245  }
246 
247 
248  m_ambiguitiesMap =new PixelGangedClusterAmbiguities();
249 
250 
251  // get the container(s)
252  using TimedHitCollList = PileUpMergeSvc::TimedList<SiHitCollection>::type;
253 
254  //this is a list<pair<time_t, DataLink<SCTUncompressedHitCollection> > >
255  TimedHitCollList hitCollList;
256  unsigned int numberOfSimHits(0);
257  if ( !(m_mergeSvc->retrieveSubEvtsData(m_inputObjectName.value(), hitCollList, numberOfSimHits).isSuccess()) && hitCollList.empty() ) {
258  ATH_MSG_ERROR ( "Could not fill TimedHitCollList" );
259  return StatusCode::FAILURE;
260  } else {
261  ATH_MSG_DEBUG ( hitCollList.size() << " SiHitCollections with key " << m_inputObjectName << " found" );
262  }
263 
264  // Define Hit Collection
265  TimedHitCollection<SiHit> thpcsi(numberOfSimHits);
266 
267  //now merge all collections into one
268  TimedHitCollList::iterator iColl(hitCollList.begin());
269  TimedHitCollList::iterator endColl(hitCollList.end() );
270 
272  // loop on the hit collections
273  while ( iColl != endColl ) {
274  //decide if this event will be processed depending on HardScatterSplittingMode & bunchXing
276  if (m_HardScatterSplittingMode == 1 && m_HardScatterSplittingSkipper ) { ++iColl; continue; }
278  const SiHitCollection* p_collection(iColl->second);
279  thpcsi.insert(iColl->first, p_collection);
280  ATH_MSG_DEBUG ( "SiHitCollection found with " << p_collection->size() << " hits" );
281  ++iColl;
282  }
283 
284  // Process the Hits straw by straw: get the iterator pairs for given straw
285  if(this->digitize(ctx, thpcsi).isFailure()) {
286  ATH_MSG_FATAL ( "digitize method failed!" );
287  return StatusCode::FAILURE;
288  }
289 
290  if (createAndStoreRIOs(ctx).isFailure()) {
291  ATH_MSG_FATAL ( "createAndStoreRIOs() failed!" );
292  return StatusCode::FAILURE;
293  }
294  else {
295  ATH_MSG_DEBUG ( "createAndStoreRIOs() succeeded" );
296  }
297 
298 
299  if ((evtStore()->setConst(m_pixelClusterContainer)).isFailure()) {
300  ATH_MSG_ERROR("[ ---- ] Could not set Pixel ROT container ");
301  }
302  ATH_MSG_DEBUG ("Ambiguities map has " << m_ambiguitiesMap->size() << " elements" );
304  if (sc.isFailure()){
305  ATH_MSG_FATAL ( "PixelClusterAmbiguitiesMap could not be recorded in StoreGate !" );
306  return StatusCode::FAILURE;
307  }else{
308  ATH_MSG_DEBUG ( "PixelClusterAmbiguitiesMap recorded in StoreGate" );
309  }
310 
311 
312 
313 
314  return StatusCode::SUCCESS;
315 
316 }
317 
318 
319 
321 {
322 
324 
326  ATH_MSG_FATAL( "[ --- ] Could not create PixelClusterContainer");
327  return StatusCode::FAILURE;
328  }
329 
330  InDet::SiClusterContainer* symSiContainer=nullptr;
331 
332  // --------------------------------------
333  // Pixel_Cluster container registration
334  m_pixelClusterContainer->cleanup();
335  if ((evtStore()->record(m_pixelClusterContainer, "PixelClusters")).isFailure()) {
336  ATH_MSG_FATAL("[ hitproc ] Error while registering PixelCluster container");
337  return StatusCode::FAILURE;
338  }
339 
340  // symlink the SCT Container
341  if ((evtStore()->symLink(m_pixelClusterContainer,symSiContainer)).isFailure()) {
342  ATH_MSG_FATAL( "[ --- ] PixelClusterContainer could not be symlinked to SiClusterContainter in StoreGate !" );
343  return StatusCode::FAILURE;
344  } else {
345  ATH_MSG_DEBUG( "[ hitproc ] PixelClusterContainer symlinked to SiClusterContainer in StoreGate" );
346  }
347 
348  // truth info
350 
351  if ((evtStore()->contains<PRD_MultiTruthCollection>(m_prdTruthNamePixel))){
352  if((evtStore()->retrieve(m_pixPrdTruth, m_prdTruthNamePixel)).isFailure()){
353  ATH_MSG_FATAL("Could not retrieve collection " << m_prdTruthNamePixel);
354  return StatusCode::FAILURE;
355  }
356  }else{
357  if((evtStore()->record(m_pixPrdTruth, m_prdTruthNamePixel)).isFailure()){
358  ATH_MSG_FATAL("Could not record collection " << m_prdTruthNamePixel);
359  return StatusCode::FAILURE;
360  }
361  }
362 
363  m_ambiguitiesMap =new PixelGangedClusterAmbiguities();
364 
365  if (m_thpcsi != nullptr) {
366  if(digitize(ctx, *m_thpcsi).isFailure()) {
367  ATH_MSG_FATAL ( "Pixel digitize method failed!" );
368  return StatusCode::FAILURE;
369  }
370  }
371 
372  delete m_thpcsi;
373  for(SiHitCollection* ptr : m_siHitCollList) delete ptr;
374  m_siHitCollList.clear();
375 
376 
377  if (createAndStoreRIOs(ctx).isFailure()) {
378  ATH_MSG_FATAL ( "createAndStoreRIOs() failed!" );
379  return StatusCode::FAILURE;
380  }
381  else {
382  ATH_MSG_DEBUG ( "createAndStoreRIOs() succeeded" );
383  }
384 
385  if ((evtStore()->setConst(m_pixelClusterContainer)).isFailure()) {
386  ATH_MSG_ERROR("[ ---- ] Could not set Pixel ROT container ");
387  }
388  ATH_MSG_DEBUG ("Ambiguities map has " << m_ambiguitiesMap->size() << " elements" );
390  if (sc.isFailure()){
391  ATH_MSG_FATAL ( "PixelClusterAmbiguitiesMap could not be recorded in StoreGate !" );
392  return StatusCode::FAILURE;
393  }else{
394  ATH_MSG_DEBUG ( "PixelClusterAmbiguitiesMap recorded in StoreGate" );
395  }
396 
397 
398 
399  return StatusCode::SUCCESS;
400 }
401 
402 
405 {
406  // Set the RNG to use for this event.
407  ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this, m_randomEngineName);
408  const std::string rngName = name()+m_randomEngineName;
409  rngWrapper->setSeed( rngName, ctx );
410  CLHEP::HepRandomEngine *rndmEngine = rngWrapper->getEngine(ctx);
411 
413  const InDetDD::SiDetectorElementCollection* elements(*pixelDetEleHandle);
414  if (not pixelDetEleHandle.isValid() or elements==nullptr) {
415  ATH_MSG_FATAL(m_pixelDetEleCollKey.fullKey() << " is not available.");
416  return StatusCode::FAILURE;
417  }
418 
420 
422  else { m_pixelClusterMap->clear(); }
423 
425  const PixelChargeCalibCondData *calibData = *calibDataHandle;
427  std::vector<int> truthIdList;
428  std::vector<Identifier> detEl;
429 
430  while (thpcsi.nextDetectorElement(i, e)) {
431 
432  Pixel_detElement_RIO_map PixelDetElClusterMap;
433 
434  truthIdList.clear();
435  detEl.clear();
436 
437  while (i != e) {
438 
439  const TimedHitPtr<SiHit>& hit(*i++);
440  // check the status of truth information for this SiHit
441  // some Truth information is cut for pile up events
442  const HepMcParticleLink currentLink = HepMcParticleLink::getRedirectedLink(hit->particleLink(), hit.eventId(), ctx); // This link should now correctly resolve to the TruthEvent McEventCollection in the main StoreGateSvc.
443  const int barrelEC = hit->getBarrelEndcap();
444  const int layerDisk = hit->getLayerDisk();
445  const int phiModule = hit->getPhiModule();
446  const int etaModule = hit->getEtaModule();
447 
448  const Identifier moduleID = m_pixel_ID->wafer_id(barrelEC, layerDisk, phiModule, etaModule);
449  const IdentifierHash waferHash = m_pixel_ID->wafer_hash(moduleID);
450  const InDetDD::SiDetectorElement* hitSiDetElement = elements->getDetectorElement(waferHash);
451  if (!hitSiDetElement) {ATH_MSG_ERROR( " could not get detector element "); continue;}
452 
453  if (!(hitSiDetElement->isPixel())) {continue;}
454 
455 
456 
457  std::vector<HepMcParticleLink> hit_vector; //Store the hits in merged cluster
458 
459  const int truthID = (currentLink.barcode() !=0 && currentLink.id() == 0) ? 3 : currentLink.id(); // FIXME barcode-based Patch for reading in legacy barcode-based EDM - if the barcode is non-zero, but the id is zero then we must be looking at a particle linked to suppressed pile-up truth - such SiHits would be linked to the third GenParticle in their GenEvents (if they were present)
460 
461  const Identifier hitId = hitSiDetElement->identify(); // Isn't this is identical to moduleID?
462  //const IdentifierHash hitIdHash = hitSiDetElement->identifyHash();
463 
464 
465  bool isRep = false;
466 
467  for (int j : truthIdList) {
468  for (auto & k : detEl) {
469  if ((truthID > 0) && (truthID == j) && (hitId == k)) {isRep = true; break;}
470  }
471  if (isRep) break;
472  }
473 
474  if (isRep) continue;
475 
476  truthIdList.push_back(truthID);
477  detEl.push_back(hitId);
478 
479  HepGeom::Point3D<double> localStartPosition = hit->localStartPosition();
480  HepGeom::Point3D<double> localEndPosition = hit->localEndPosition();
481 
482  localStartPosition = hitSiDetElement->hitLocalToLocal3D(localStartPosition);
483  localEndPosition = hitSiDetElement->hitLocalToLocal3D(localEndPosition);
484 
485  int isEndcap = (barrelEC==0) ? 0:1;
486 
487  double shiftX = isEndcap ? m_pixDiffShiftEndCX : m_pixDiffShiftBarrX;
488  double shiftY = isEndcap ? m_pixDiffShiftEndCY : m_pixDiffShiftBarrY;
489 
490  // std::cout<<"Thr "<<m_ThrConverted<<std::endl;
491 
492  //New function to tune the cluster size
493  Diffuse(localStartPosition, localEndPosition, shiftX, shiftY);
494 
495  const Amg::Vector3D localDirection(localEndPosition.x()-localStartPosition.x(), localEndPosition.y()-localStartPosition.y(), localEndPosition.z()-localStartPosition.z());
496 
497  Amg::Vector3D entryPoint(localStartPosition.x(),localStartPosition.y(),localStartPosition.z());
498  Amg::Vector3D exitPoint(localEndPosition.x(),localEndPosition.y(),localEndPosition.z());
499 
500  const InDetDD::PixelModuleDesign* design(dynamic_cast<const InDetDD::PixelModuleDesign*>(&hitSiDetElement->design()));
501  if (not design){
502  ATH_MSG_FATAL("Failed to cast the hitSiDetElement::design pointer to a PixelModuleDesign*; aborting due to null pointer");
503  return StatusCode::FAILURE;
504  }
505  const Amg::Vector2D localEntry(localStartPosition.x(),localStartPosition.y());
506  const Amg::Vector2D localExit(localEndPosition.x(),localEndPosition.y());
507 
508  Identifier entryId = hitSiDetElement->identifierOfPosition(localEntry);
509  Identifier exitId = hitSiDetElement->identifierOfPosition(localExit);
510 
511  InDetDD::SiCellId entryCellId = hitSiDetElement->cellIdFromIdentifier(entryId);
512  InDetDD::SiCellId exitCellId = hitSiDetElement->cellIdFromIdentifier(exitId);
513 
514  double halfthickness = hitSiDetElement->thickness()*0.5;
515 
516  bool EntryValid(entryCellId.isValid());
517  bool ExitValid(exitCellId.isValid());
518 
519  double pixMinimalPathCut= 1. / m_pixPathLengthTotConv;
520 
521  Identifier diodeID = hitId;
522  unsigned int FE = m_pixelReadout->getFE(diodeID, moduleID);
523  InDetDD::PixelDiodeType type = m_pixelReadout->getDiodeType(diodeID);
524 
525  double th0 = calibData->getThresholds(type, waferHash, FE).value/ m_ThrConverted;
526 
527  // if (old_th != th0) std::cout<<"converted threshold "<<th0<<std::endl, old_th= th0;
528 
529  //Avoid to store pixels with 0 ToT
530  //if (m_pixMinimalPathCut > pixMinimalPathCut) pixMinimalPathCut=m_pixMinimalPathCut;
531  //if (th0 > pixMinimalPathCut) ;
532  pixMinimalPathCut=th0;
533 
534  if (!EntryValid || !ExitValid)
535  {
536  //If entry or exit aren't valid search for the valid entry/exit of the hit as Intersection with the module
537 
538  if ( !EntryValid && !ExitValid) continue;
539 
540  Amg::Vector3D Point = EntryValid ? entryPoint : exitPoint ;
541 
542  Amg::Vector3D Intersection = CalculateIntersection(Point, localDirection, Amg::Vector2D(design->width() * 0.5,design->length() * 0.5),halfthickness);
543 
544  if( Intersection == Amg::Vector3D(0.,0.,0.))
545  {
546  ATH_MSG_WARNING("ATTENTION THE INTERSECTION COORDINATE IS OUT OF THE MODULE");
547  continue;
548  }
549 
550  const Amg::Vector2D Intersection_2d(Intersection.x(),Intersection.y());
551  Identifier Intersection_2dId = hitSiDetElement->identifierOfPosition(Intersection_2d);
552 
553  InDetDD::SiCellId Intersection_2dCellId = hitSiDetElement->cellIdFromIdentifier(Intersection_2dId);
554 
555 
556  if(!Intersection_2dCellId.isValid()) continue;
557 
558  if(EntryValid)
559  exitPoint = Intersection;
560  else
561  entryPoint = Intersection;
562 
563 
564  }
565 
566 
567 
568  Trk::DigitizationModule * digitizationModule = buildDetectorModule(hitSiDetElement);
569  if(!digitizationModule){
570  ATH_MSG_FATAL( " could not get build detector module ");
571  return StatusCode::FAILURE;
572  }
573 
574  // Getting the steps in the sensor
575  std::vector<Trk::DigitizationStep> digitizationSteps = m_digitizationStepper->cellSteps(*digitizationModule,entryPoint,exitPoint);
576 
577 
578 
579  // the pixel positions and other needed stuff for the geometrical clustering
580  std::unique_ptr<InDet::PixelCluster> pixelCluster = nullptr;
581  Amg::Vector2D clusterPosition(0.,0.);
582 
583  std::vector<Identifier> rdoList;
584  std::vector<int> totList;
585 
586  const bool isGanged = false;
587  int lvl1a = 0;
588 
589  double accumulatedPathLength=0.;
590 
591  //ATTENTION index max e min da rdo + manager
592  int phiIndexMax = -999999;
593  int phiIndexMin = 1000000;
594  int etaIndexMax = -999999;
595  int etaIndexMin = 1000000;
596 
597 
598  for (auto& dStep : digitizationSteps){
599 
600  double pathlength = dStep.stepLength;
601  // two options fro charge smearing: landau / gauss
602  if ( m_pixSmearPathLength > 0. ) {
603  // create the smdar parameter
604  double sPar = m_pixSmearLandau ?
605  m_pixSmearPathLength*CLHEP::RandLandau::shoot(rndmEngine) :
606  m_pixSmearPathLength*CLHEP::RandGaussZiggurat::shoot(rndmEngine);
607  pathlength *= (1.+sPar);
608  }
609 
610 
611  if (pathlength < pixMinimalPathCut) continue;
612 
613  // position on the diode map
614  Trk::DigitizationCell cell(dStep.stepCell.first,dStep.stepCell.second);
615  Amg::Vector2D PositionOnModule = digitizationModule->segmentation().cellPosition(cell);
616  InDetDD::SiCellId diode = hitSiDetElement->cellIdOfPosition(PositionOnModule);
617 
618 
619  if (!diode.isValid())
620  continue;
621 
622  Amg::Vector2D chargeCenterPosition = hitSiDetElement->rawLocalPositionOfCell(diode);
623 
624  const Identifier rdoId = hitSiDetElement->identifierOfPosition(chargeCenterPosition);
625  clusterPosition += pathlength * chargeCenterPosition;
626 
627  int currentEtaIndex = diode.etaIndex();
628  int currentPhiIndex = diode.phiIndex();
629  if(currentEtaIndex > etaIndexMax) etaIndexMax = currentEtaIndex;
630  if(currentEtaIndex < etaIndexMin) etaIndexMin = currentEtaIndex;
631  if(currentPhiIndex > phiIndexMax) phiIndexMax = currentPhiIndex;
632  if(currentPhiIndex < phiIndexMin) phiIndexMin = currentPhiIndex;
633 
634 
635  // record - positions, rdoList and totList
636  accumulatedPathLength += pathlength;
637  //Fail
638  rdoList.push_back(rdoId);
639  totList.push_back(int(pathlength*m_pixPathLengthTotConv));
640 
641  }
642 
643  delete digitizationModule;
644 
645  // the col/row
646  int siDeltaPhiCut = phiIndexMax-phiIndexMin+1;
647  int siDeltaEtaCut = etaIndexMax-etaIndexMin+1;
648 
649  int totalToT=std::accumulate(totList.begin(), totList.end(), 0);;
650 
651  // bail out if 0 pixel or path length problem
652  if (rdoList.empty() || accumulatedPathLength < pixMinimalPathCut || totalToT == 0) {
653  if (totalToT == 0 && !rdoList.empty() ) ATH_MSG_WARNING("The total ToT of the cluster is 0, this should never happen");
654  continue;
655  }
656 
657  // weight the cluster position
658  clusterPosition *= 1./accumulatedPathLength;
659  Identifier clusterId = hitSiDetElement->identifierOfPosition(clusterPosition);
660 
661 
662  // merging clusters
663 
664  bool merged = false;
665  if(m_mergeCluster){ // merge to the current cluster "near" cluster in the cluster map, in the current detector element
666 
667  for(Pixel_detElement_RIO_map::iterator currentClusIter = PixelDetElClusterMap.begin(); currentClusIter != PixelDetElClusterMap.end();) {
668  //make a temporary to use within the loop and possibly erase - increment the main interator at the same time.
669  Pixel_detElement_RIO_map::iterator clusIter = currentClusIter++;
670  InDet::PixelCluster* currentCluster = clusIter->second;
671  const std::vector<Identifier> &currentRdoList = currentCluster->rdoList();
672  bool areNb = false;
673  for (auto rdoIter : rdoList) {
674  areNb = PixelFastDigitizationTool::areNeighbours(currentRdoList, rdoIter, hitSiDetElement,*m_pixel_ID);
675  if (areNb) { break; }
676  }
677  if (areNb) {
678  const std::vector<int> &currentTotList = currentCluster->totList();
679  rdoList.insert(rdoList.end(), currentRdoList.begin(), currentRdoList.end() );
680  totList.insert(totList.end(), currentTotList.begin(), currentTotList.end() );
681  Amg::Vector2D currentClusterPosition(currentCluster->localPosition());
682  float c1 = (float)currentRdoList.size();
683  float c2 = (float)rdoList.size();
684  clusterPosition = (clusterPosition*c2 + currentClusterPosition*c1)/((c1 + c2));
685  clusterId = hitSiDetElement->identifierOfPosition(clusterPosition);
686  merged = true;
687  PixelDetElClusterMap.erase(clusIter);
688 
689  //Store HepMcParticleLink connected to the cluster removed from the collection
690  std::pair<PRD_MultiTruthCollection::iterator,PRD_MultiTruthCollection::iterator> saved_hit = m_pixPrdTruth->equal_range(currentCluster->identify());
691  for (PRD_MultiTruthCollection::iterator this_hit = saved_hit.first; this_hit != saved_hit.second; ++this_hit)
692  {
693  hit_vector.push_back(this_hit->second);
694  }
695  //Delete all the occurency of the currentCluster from the multi map
696  if (saved_hit.first != saved_hit.second) m_pixPrdTruth->erase(currentCluster->identify());
697  delete currentCluster;
698  //break; //commenting out this break statement allows for multiple existing clusters to be merged.
699  }
700  }
701  }
702 
703  bool not_valid = false;
704  for (auto & entry : rdoList) {
705  if (!(entry.is_valid())) { not_valid = true; break;}
706  }
707 
708  if (not_valid) continue;
709 
710  if(merged) {
711  //Hacks for merged clusters
712  for (auto rdoIter : rdoList) {
713  const InDetDD::SiCellId& chargeCellId = hitSiDetElement->cellIdFromIdentifier(rdoIter);
714  // phi/ eta index
715  int chargePhiIndex = chargeCellId.phiIndex();
716  int chargeEtaIndex = chargeCellId.etaIndex();
717  // set max min
718  phiIndexMin = chargePhiIndex < phiIndexMin ? chargePhiIndex : phiIndexMin;
719  phiIndexMax = chargePhiIndex > phiIndexMax ? chargePhiIndex : phiIndexMax;
720  etaIndexMin = chargeEtaIndex < etaIndexMin ? chargeEtaIndex : etaIndexMin;
721  etaIndexMax = chargeEtaIndex > etaIndexMax ? chargeEtaIndex : etaIndexMax;
722  }
723  siDeltaPhiCut = (phiIndexMax-phiIndexMin)+1;
724  siDeltaEtaCut = (etaIndexMax-etaIndexMin)+1;
725  }
726 
727  // ---------------------------------------------------------------------------------------------
728  // PART 2: Cluster && ROT creation
729 
730 
731  //ATTENTION
732  // // correct shift implied by the scaling of the Lorentz angle
733  // double newshift = 0.5*thickness*tanLorAng;
734  // double corr = ( shift - newshift );
735  // 2a) Cluster creation ------------------------------------
736  if (m_pixUseClusterMaker) {
737 
738  // from InDetReadoutGeometry: width from eta
739  const auto* pixModDesign =
740  dynamic_cast<const InDetDD::PixelModuleDesign*>(
741  &hitSiDetElement->design());
742  if (!pixModDesign) {
743  return StatusCode::FAILURE;
744  }
745  double etaWidth =
746  pixModDesign->widthFromColumnRange(etaIndexMin, etaIndexMax);
747  // from InDetReadoutGeometry : width from phi
748  double phiWidth =
749  pixModDesign->widthFromRowRange(phiIndexMin, phiIndexMax);
750 
751  InDet::SiWidth siWidth(Amg::Vector2D(siDeltaPhiCut, siDeltaEtaCut),
752  Amg::Vector2D(phiWidth, etaWidth));
753 
754  // use the cluster maker from the offline software
755  pixelCluster =
756  std::make_unique<PixelCluster>(m_clusterMaker->pixelCluster(
757  clusterId, clusterPosition, std::vector<Identifier>(rdoList),
758  lvl1a, std::vector<int>(totList), siWidth,
759  hitSiDetElement, isGanged, m_pixErrorStrategy, *m_pixel_ID,
760  false, 0.0, 0.0, calibData, *offlineCalibData, ctx));
761  if (isGanged) {
762  pixelCluster->setGangedPixel(isGanged);
763  }
764  } else {
766  "[ cluster - pix ] No pixels errors provided, but configured to "
767  "use them.");
769  " -> No pixels cluster will be created.");
770  continue;
771  }
772 
773  if (!(pixelCluster->identify().is_valid())) {
774  pixelCluster.reset();
775  continue;
776  }
777 
778  if (!(m_pixel_ID->is_pixel(pixelCluster->identify()))) {
779  pixelCluster.reset();
780  continue;
781  }
782 
783  const auto it =
784  PixelDetElClusterMap.insert(Pixel_detElement_RIO_map::value_type(
785  waferHash, pixelCluster.release()));
786  const PixelCluster* insertedCluster = it->second;
787 
788  if (currentLink.isValid()) {
789  if (!HepMC::ignoreTruthLink(currentLink, m_vetoPileUpTruthLinks)) {
790  m_pixPrdTruth->insert(
791  std::make_pair(insertedCluster->identify(), currentLink));
792  ATH_MSG_DEBUG("Truth map filled with cluster"
793  << insertedCluster
794  << " and link = " << currentLink);
795  }
796  } else {
798  "Particle link NOT valid!! Truth map NOT filled with cluster"
799  << insertedCluster << " and link = " << currentLink);
800  }
801 
802  // Add all hit that was connected to the cluster
803  for (const HepMcParticleLink& p : hit_vector) {
804 
805  m_pixPrdTruth->insert(std::make_pair(insertedCluster->identify(), p ));
806  }
807 
808  hit_vector.clear();
809  } // end hit while
810 
811 
812  (void) m_pixelClusterMap->insert(PixelDetElClusterMap.begin(), PixelDetElClusterMap.end());
813 
814 
815  } // end nextDetectorElement while
816 
817 
818  return StatusCode::SUCCESS;
819 }
820 
822 {
824  const InDetDD::SiDetectorElementCollection* elements(*pixelDetEleHandle);
825  if (not pixelDetEleHandle.isValid() or elements==nullptr) {
826  ATH_MSG_FATAL(m_pixelDetEleCollKey.fullKey() << " is not available.");
827  return StatusCode::FAILURE;
828  }
829 
832 
833  InDet::PixelClusterCollection* clusterCollection = nullptr;
834  IdentifierHash waferHash;
835 
836  for (; i != e; i = m_pixelClusterMap->upper_bound(i->first)){
837 
838  std::pair <Pixel_detElement_RIO_map::iterator, Pixel_detElement_RIO_map::iterator> range;
839  range = m_pixelClusterMap->equal_range(i->first);
840 
842  firstDetElem = range.first;
843 
844  waferHash = firstDetElem->first;
845 
846  const InDetDD::SiDetectorElement* detElement = elements->getDetectorElement(waferHash);
847 
848  clusterCollection = new InDet::PixelClusterCollection(waferHash);
849  clusterCollection->setIdentifier(detElement->identify());
850 
851 
852  for ( Pixel_detElement_RIO_map::iterator iter = range.first; iter != range.second; ++iter){
853 
854  InDet::PixelCluster* pixelCluster = (*iter).second;
855  pixelCluster->setHashAndIndex(clusterCollection->identifyHash(),clusterCollection->size());
856  clusterCollection->push_back(pixelCluster);
857 
858  }
859 
860 
861  if (clusterCollection) {
862  if (!clusterCollection->empty()) {
863  ATH_MSG_DEBUG ( "Filling ambiguities map" );
864  m_gangedAmbiguitiesFinder->execute(clusterCollection,*m_ambiguitiesMap);
865  ATH_MSG_DEBUG ( "Ambiguities map: " << m_ambiguitiesMap->size() << " elements" );
866  if ((m_pixelClusterContainer->addCollection(clusterCollection, waferHash)).isFailure()){
867  ATH_MSG_WARNING( "Could not add collection to Identifyable container !" );
868  }
869  }
870  else {delete clusterCollection;}
871  }
872 
873 
874  } // end for
875 
876  m_pixelClusterMap->clear();
877 
878  return StatusCode::SUCCESS;
879 }
880 // copied from PixelClusteringToolBase
882 (const std::vector<Identifier>& group,
883  const Identifier& rdoID,
884  const InDetDD::SiDetectorElement* /*element*/,
885  const PixelID& pixelID)
886 {
887  // note: in the PixelClusteringToolBase, m_splitClusters is a variable; here
888  // splitClusters was explicitly set to zero, acceptDiagonalClusters = 1
889  // so much of the original code is redundant and only one path through the code
890  // is possible.
891 
892  std::vector<Identifier>::const_iterator groupBegin = group.begin();
893  std::vector<Identifier>::const_iterator groupEnd = group.end();
894 
895  int row2 = pixelID.phi_index(rdoID);
896  int col2 = pixelID.eta_index(rdoID);
897 
898  int rowmax = row2;
899  bool match=false;
900  while (groupBegin!=groupEnd)
901  {
902  Identifier id = *groupBegin;
903  int row1 = pixelID.phi_index(id);
904  int col1 = pixelID.eta_index(id);
905  if(row1 > rowmax) rowmax = row1;
906  int deltarow = abs(row2-row1);
907  int deltacol = abs(col2-col1);
908 
909  // a side in common
910  if(deltacol+deltarow < 2) match = true;
911  //condition "if (acceptDiagonalClusters !=0") is redundant
912  if(deltacol == 1 && deltarow == 1) match = true;
913 
914  ++groupBegin;
915  }
916 
917 
918  return match;
919 }
920 
922 
923  const InDetDD::PixelModuleDesign* design(dynamic_cast<const InDetDD::PixelModuleDesign*>(&hitSiDetElement->design()));
924 
925  if (!design) {
926  ATH_MSG_DEBUG ( "Could not get design"<< design) ;
927  return nullptr;
928  }
929 
930  //Read from the SiDetectorElement information to build the digitization module
931  const double halfThickness = hitSiDetElement->thickness() * 0.5;
932  const double halfWidth = design->width() * 0.5;
933  const double halfLength = design->length() * 0.5;
934 
935  int binsX = design->rows();
936  int binsY = design->columns();
937  double numberOfChip = design->numberOfCircuits();
938 
940  float LongPitch =design->parameters(cell).width().xEta();
941  //std::cout<<"numberOfChip "<<numberOfChip<<" LongPitch "<<LongPitch<<std::endl;
942 
943  ATH_MSG_VERBOSE("Retrieving infos: halfThickness = " << halfThickness << " --- halfWidth = " << halfWidth << " --- halfLength = " << halfLength );
944  ATH_MSG_VERBOSE("Retrieving infos: binsX = " << binsX << " --- binsY = " << binsY << " --- numberOfChip = " << numberOfChip);
945 
946  int readoutDirection = design->readoutSide();
947 
948  const bool useLorentzAngle{true};
949  const IdentifierHash detElHash = hitSiDetElement->identifyHash();
950  float lorentzAngle = useLorentzAngle ? hitSiDetElement->hitDepthDirection()*hitSiDetElement->hitPhiDirection()*std::atan(m_lorentzAngleTool->getTanLorentzAngle(detElHash, Gaudi::Hive::currentContext())) : 0.;
951 
952  // added for degugging
953 
954  // std::cout << "barrel_ec = " << m_detID->barrel_ec(hitSiDetElement->identify())
955  // << " -- layer_disk = " << m_detID->layer_disk(hitSiDetElement->identify())
956  // << " -- eta_module = " << m_detID->eta_module(hitSiDetElement->identify())
957  // << " -- lorentzAngle = " << lorentzAngle
958  // << " -- lorentzCorrection = " << shift
959  // << " -- readoutDirection = " << readoutDirection << std::endl;
960  // std::cout << "element->hitDepthDirection() = " << hitSiDetElement->hitDepthDirection()
961  // << " -- element->hitPhiDirection() = " << hitSiDetElement->hitPhiDirection() << std::endl;
962 
963  // rectangle bounds
964  auto rectangleBounds = std::make_shared<const Trk::RectangleBounds>(halfWidth,halfLength);
965  ATH_MSG_VERBOSE("Initialized rectangle Bounds");
966  // create the segmentation
967  std::shared_ptr<const Trk::Segmentation> rectangleSegmentation(new Trk::RectangularSegmentation(std::move(rectangleBounds),(size_t)binsX,LongPitch,(size_t)binsY, numberOfChip));
968  // build the module
969  ATH_MSG_VERBOSE("Initialized rectangleSegmentation");
970  Trk::DigitizationModule * digitizationModule = new Trk::DigitizationModule(std::move(rectangleSegmentation),
971  halfThickness,
972  readoutDirection,
973  lorentzAngle);
974  ATH_MSG_VERBOSE("Building Rectangle Segmentation with dimensions (halfX, halfY) = (" << halfWidth << ", " << halfLength << ")");
975 
976  // success return
977  return digitizationModule;
978 }
979 
980 
982 {
983  Amg::Vector3D Intersection(0.,0.,0.);
984 
985  //Using parameter definition of a line in 3d z=z_point + direction_z t
986  std::vector<double> parameters;
987  parameters.push_back((PlaneBorder.x() - Point.x())/Direction.x());
988  parameters.push_back((-PlaneBorder.x() - Point.x())/Direction.x());
989  parameters.push_back((PlaneBorder.y() - Point.y())/Direction.y());
990  parameters.push_back((-PlaneBorder.y() - Point.y())/Direction.y());
991 
992  for(double parameter: parameters)
993  {
994  double z = Point.z() + Direction.z() * parameter;
995  if( std::abs(z) > halfthickness )
996  continue;
997 
998 
999  double x = Point.x() + Direction.x() * parameter;
1000  double y = Point.y() + Direction.y() * parameter;
1001 
1002  if(std::abs(x) > PlaneBorder.x() || std::abs(y) > PlaneBorder.y())
1003  continue;
1004 
1005 
1006  Intersection = Amg::Vector3D(x,y,z);
1007  break;
1008 
1009  }
1010 
1011  return Intersection;
1012 }
1013 
1014 void PixelFastDigitizationTool::Diffuse(HepGeom::Point3D<double>& localEntry, HepGeom::Point3D<double>& localExit, double shiftX, double shiftY) {
1015 
1016  double localEntryX = localEntry.x();
1017  double localEntryY = localEntry.y();
1018  double localExitX = localExit.x();
1019  double localExitY = localExit.y();
1020 
1021  double signX = localExitX>localEntryX ? 1:-1 ;
1022  double signY = localExitY>localEntryY ? 1:-1 ;
1023 
1024  localEntryX += shiftX*signX*(-1);
1025  localExitX += shiftX*signX;
1026  localEntryY += shiftY*signY*(-1);
1027  localExitY += shiftY*signY;
1028 
1029  localEntry.setX(localEntryX);
1030  localEntry.setY(localEntryY);
1031  localExit.setX(localExitX);
1032  localExit.setY(localExitY);
1033 
1034 }
InDetDD::SolidStateDetectorElementBase::hitLocalToLocal3D
HepGeom::Point3D< double > hitLocalToLocal3D(const HepGeom::Point3D< double > &hitPosition) const
Same as previuos method but 3D.
Definition: SolidStateDetectorElementBase.cxx:117
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
PixelFastDigitizationTool::m_pixel_ID
const PixelID * m_pixel_ID
Handle to the ID helper.
Definition: PixelFastDigitizationTool.h:97
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
AtlasDetectorID::is_pixel
bool is_pixel(Identifier id) const
Definition: AtlasDetectorID.h:760
InDetDD::SolidStateDetectorElementBase::identifierOfPosition
Identifier identifierOfPosition(const Amg::Vector2D &localPos) const
Full identifier of the cell for a given position: assumes a raw local position (no Lorentz shift)
Definition: SolidStateDetectorElementBase.cxx:217
TrapezoidBounds.h
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
ATHRNG::RNGWrapper::setSeed
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Definition: RNGWrapper.h:169
PixelFastDigitizationTool::CalculateIntersection
static Amg::Vector3D CalculateIntersection(const Amg::Vector3D &Point, const Amg::Vector3D &Direction, Amg::Vector2D PlaneBorder, double halfthickness)
Definition: PixelFastDigitizationTool.cxx:981
SiWidth.h
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
PixelID::phi_index
int phi_index(const Identifier &id) const
Definition: PixelID.h:658
InDetDD::SolidStateDetectorElementBase::cellIdOfPosition
SiCellId cellIdOfPosition(const Amg::Vector2D &localPos) const
As in previous method but returns SiCellId.
Definition: SolidStateDetectorElementBase.cxx:224
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
PixelFastDigitizationTool::processAllSubEvents
StatusCode processAllSubEvents(const EventContext &ctx)
Definition: PixelFastDigitizationTool.cxx:204
PixelFastDigitizationTool::m_ThrConverted
DoubleProperty m_ThrConverted
Definition: PixelFastDigitizationTool.h:136
Trk::Segmentation::cellPosition
virtual const Amg::Vector2D cellPosition(const DigitizationCell &dCell) const =0
calculate the cell Position from the Id
PixelFastDigitizationTool::m_pixDiffShiftBarrY
DoubleProperty m_pixDiffShiftBarrY
Definition: PixelFastDigitizationTool.h:133
InDetDD::SiDetectorElementCollection
Definition: SiDetectorElementCollection.h:30
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
InDetDD::PixelModuleDesign::width
virtual double width() const
Method to calculate average width of a module.
Definition: PixelModuleDesign.cxx:113
PixelFastDigitizationTool::m_HardScatterSplittingSkipper
bool m_HardScatterSplittingSkipper
Definition: PixelFastDigitizationTool.h:108
RectangleBounds.h
InDetDD::PixelModuleDesign
Definition: PixelModuleDesign.h:48
InDetDD::PixelModuleDesign::columns
int columns() const
Number of cell columns per module:
Definition: PixelModuleDesign.h:322
PixelCluster.h
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
PixelFastDigitizationTool::m_lorentzAngleTool
ToolHandle< ISiLorentzAngleTool > m_lorentzAngleTool
Definition: PixelFastDigitizationTool.h:100
PixelFastDigitizationTool::PixelFastDigitizationTool
PixelFastDigitizationTool()
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
PixelChargeCalibCondData::getThresholds
PixelChargeCalib::Thresholds getThresholds(InDetDD::PixelDiodeType type, unsigned int moduleHash, unsigned int FE) const
Definition: PixelChargeCalibCondData.cxx:99
PRD_MultiTruthCollection
A PRD is mapped onto all contributing particles.
Definition: PRD_MultiTruthCollection.h:24
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
PixelFastDigitizationTool::m_pixErrorStrategy
IntegerProperty m_pixErrorStrategy
error strategy for the ClusterMaker
Definition: PixelFastDigitizationTool.h:131
extractSporadic.c1
c1
Definition: extractSporadic.py:134
LineIntersection2D.h
InDetDD::PixelModuleDesign::rows
int rows() const
Number of cell rows per module:
Definition: PixelModuleDesign.h:327
PixelFastDigitizationTool::m_digitizationStepper
PublicToolHandle< Trk::IModuleStepper > m_digitizationStepper
Definition: PixelFastDigitizationTool.h:164
AtlasHitsVector
Definition: AtlasHitsVector.h:33
InDetDD::SiCellId::isValid
bool isValid() const
Test if its in a valid state.
Definition: SiCellId.h:136
InDetDD::PixelDiodeType
PixelDiodeType
Definition: PixelReadoutDefinitions.h:25
skel.it
it
Definition: skel.GENtoEVGEN.py:396
SurfaceCollection.h
ChargeCalibParameters.h
Structs for holding charge calibration parameterisation and data.
InDetDD::SolidStateDetectorElementBase::hitPhiDirection
double hitPhiDirection() const
See previous method.
SG::ReadCondHandle::isValid
bool isValid()
Definition: ReadCondHandle.h:206
Trk::DigitizationModule
Definition: DigitizationModule.h:50
Trk::PrepRawData::rdoList
const std::vector< Identifier > & rdoList() const
return the List of rdo identifiers (pointers)
InDetDD::DetectorDesign::readoutSide
int readoutSide() const
ReadoutSide.
Definition: DetectorDesign.h:291
PixelFastDigitizationTool::m_distortionKey
SG::ReadCondHandleKey< PixelDistortionData > m_distortionKey
Definition: PixelFastDigitizationTool.h:152
PixelFastDigitizationTool::m_pixPathLengthTotConv
DoubleProperty m_pixPathLengthTotConv
from path length to tot
Definition: PixelFastDigitizationTool.h:127
PileUpTimeEventIndex::index
index_type index() const
the index of the component event in PileUpEventInfo
Definition: PileUpTimeEventIndex.cxx:76
PixelFastDigitizationTool::m_rndmSvc
ServiceHandle< IAthRNGSvc > m_rndmSvc
Random number service.
Definition: PixelFastDigitizationTool.h:93
PixelFastDigitizationTool::m_mergeSvc
ServiceHandle< PileUpMergeSvc > m_mergeSvc
PileUp Merge service.
Definition: PixelFastDigitizationTool.h:106
InDetDD::SiCellId::phiIndex
int phiIndex() const
Get phi index. Equivalent to strip().
Definition: SiCellId.h:122
TimedHitPtr< SiHit >
InDet::PixelClusterContainer
Trk::PrepRawDataContainer< PixelClusterCollection > PixelClusterContainer
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelClusterContainer.h:28
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
PixelFastDigitizationTool::buildDetectorModule
Trk::DigitizationModule * buildDetectorModule(const InDetDD::SiDetectorElement *) const
Definition: PixelFastDigitizationTool.cxx:921
HepMC::ignoreTruthLink
bool ignoreTruthLink(const T &p, bool vetoPileUp)
Helper function for SDO creation in PileUpTools.
Definition: MagicNumbers.h:332
PixelFastDigitizationTool::m_pixUseClusterMaker
BooleanProperty m_pixUseClusterMaker
use the pixel cluster maker or not
Definition: PixelFastDigitizationTool.h:101
x
#define x
TimedHitCollection::nextDetectorElement
bool nextDetectorElement(const_iterator &b, const_iterator &e)
sets an iterator range with the hits of current detector element returns a bool when done
DataHandle.h
GenParticle.h
TrapezoidSegmentation.h
InDet::PixelCluster::totList
const std::vector< int > & totList() const
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:201
InDetDD::SolidStateDetectorElementBase::identifyHash
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
PixelID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition: PixelID.h:364
IPixelClusteringTool.h
Trk::DigitizationCell
std::pair< size_t, size_t > DigitizationCell
Definition: DigitizationCell.h:18
drawFromPickle.atan
atan
Definition: drawFromPickle.py:36
PileUpToolBase::m_vetoPileUpTruthLinks
Gaudi::Property< int > m_vetoPileUpTruthLinks
Definition: PileUpToolBase.h:58
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
InDetDD::Point::z
double z() const
Definition: VolumeSplitterUtils.h:28
InDetDD::PixelModuleDesign::length
virtual double length() const
Method to calculate length of a module.
Definition: PixelModuleDesign.cxx:107
PileUpMergeSvc::TimedList::type
std::list< value_t > type
type of the collection of timed data object
Definition: PileUpMergeSvc.h:75
PixelFastDigitizationTool::m_pixel_SiClustersName
StringProperty m_pixel_SiClustersName
Definition: PixelFastDigitizationTool.h:104
PixelFastDigitizationTool::m_siHitCollList
std::vector< SiHitCollection * > m_siHitCollList
name of the sub event hit collections.
Definition: PixelFastDigitizationTool.h:120
PixelFastDigitizationTool::m_HardScatterSplittingMode
IntegerProperty m_HardScatterSplittingMode
Process all SiHit or just those from signal or background events.
Definition: PixelFastDigitizationTool.h:107
InDetDD::SolidStateDetectorElementBase::hitDepthDirection
double hitDepthDirection() const
Directions of hit depth,phi,eta axes relative to reconstruction local position axes (LocalPosition).
PixelFastDigitizationTool::~PixelFastDigitizationTool
~PixelFastDigitizationTool()
Destructor.
Definition: PixelFastDigitizationTool.cxx:76
PixelFastDigitizationTool::m_clusterMaker
PublicToolHandle< InDet::ClusterMakerTool > m_clusterMaker
ToolHandle to ClusterMaker.
Definition: PixelFastDigitizationTool.h:99
PixelFastDigitizationTool::m_chargeDataKey
SG::ReadCondHandleKey< PixelChargeCalibCondData > m_chargeDataKey
Definition: PixelFastDigitizationTool.h:147
PixelFastDigitizationTool::Pixel_detElement_RIO_map
std::multimap< IdentifierHash, InDet::PixelCluster * > Pixel_detElement_RIO_map
Definition: PixelFastDigitizationTool.h:110
InDetDD::SiDetectorElement::cellIdFromIdentifier
virtual SiCellId cellIdFromIdentifier(const Identifier &identifier) const override final
SiCellId from Identifier.
Definition: SiDetectorElement.cxx:120
SiReadoutCellId.h
Trk::DigitizationModule::segmentation
const Segmentation & segmentation() const
return the segmenation
Definition: DigitizationModule.h:118
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
InDetDD::PixelModuleDesign::widthFromColumnRange
double widthFromColumnRange(const int colMin, const int colMax) const
Method to calculate eta width from a column range.
Definition: PixelModuleDesign.cxx:132
InDetDD::SiCellId::etaIndex
int etaIndex() const
Get eta index.
Definition: SiCellId.h:114
PixelID::wafer_hash
IdentifierHash wafer_hash(Identifier wafer_id) const
wafer hash from id
Definition: PixelID.h:387
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TimedHitCollection::insert
void insert(const PileUpTimeEventIndex &timeEventIndex, const AtlasHitsVector< HIT > *inputCollection)
PixelFastDigitizationTool.h
lumiFormat.i
int i
Definition: lumiFormat.py:85
PixelGangedClusterAmbiguities.h
InDetDD::SolidStateDetectorElementBase::thickness
double thickness() const
z
#define z
InDetDD::SiLocalPosition::xEta
double xEta() const
position along eta direction:
Definition: SiLocalPosition.h:118
PixelFastDigitizationTool::m_gangedAmbiguitiesFinder
PublicToolHandle< InDet::PixelGangedAmbiguitiesFinder > m_gangedAmbiguitiesFinder
Definition: PixelFastDigitizationTool.h:116
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
PixelFastDigitizationTool::mergeEvent
StatusCode mergeEvent(const EventContext &ctx)
Definition: PixelFastDigitizationTool.cxx:320
ChangeHistoRange.binsY
list binsY
Definition: ChangeHistoRange.py:59
PixelChargeCalibCondData
Definition: PixelChargeCalibCondData.h:24
PixelFastDigitizationTool::digitize
StatusCode digitize(const EventContext &ctx, TimedHitCollection< SiHit > &thpcsi)
Definition: PixelFastDigitizationTool.cxx:403
InDetDD::PixelModuleDesign::numberOfCircuits
int numberOfCircuits() const
Total number of circuits:
Definition: PixelModuleDesign.h:297
PixelFastDigitizationTool::m_randomEngineName
StringProperty m_randomEngineName
Name of the random number stream.
Definition: PixelFastDigitizationTool.h:95
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
test_pyathena.parent
parent
Definition: test_pyathena.py:15
PixelID::eta_index
int eta_index(const Identifier &id) const
Definition: PixelID.h:664
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
PixelChargeCalib::Thresholds::value
int value
Definition: ChargeCalibParameters.h:74
PixelGangedAmbiguitiesFinder.h
InDetDD::Point
Definition: VolumeSplitterUtils.h:20
PixelFastDigitizationTool::m_pixDiffShiftEndCY
DoubleProperty m_pixDiffShiftEndCY
Definition: PixelFastDigitizationTool.h:135
PileUpToolBase
Definition: PileUpToolBase.h:18
InDetDD::SiDetectorElement::isPixel
bool isPixel() const
PixelFastDigitizationTool::m_pixModuleDistortion
BooleanProperty m_pixModuleDistortion
simulationn of module bowing
Definition: PixelFastDigitizationTool.h:128
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
PixelFastDigitizationTool::initialize
StatusCode initialize()
Definition: PixelFastDigitizationTool.cxx:83
PixelFastDigitizationTool::processBunchXing
StatusCode processBunchXing(int bunchXing, SubEventIterator bSubEvents, SubEventIterator eSubEvents)
Definition: PixelFastDigitizationTool.cxx:163
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
PileUpTimeEventIndex::time
time_type time() const
bunch xing time in ns
Definition: PileUpTimeEventIndex.cxx:71
Trk::PrepRawData::localPosition
const Amg::Vector2D & localPosition() const
return the local position reference
PixelFastDigitizationTool::m_pixelClusterMap
Pixel_detElement_RIO_map * m_pixelClusterMap
Definition: PixelFastDigitizationTool.h:111
PixelFastDigitizationTool::m_thpcsi
TimedHitCollection< SiHit > * m_thpcsi
Definition: PixelFastDigitizationTool.h:91
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
PixelFastDigitizationTool::m_pixelDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
Definition: PixelFastDigitizationTool.h:155
PixelID::wafer_hash_max
size_type wafer_hash_max(void) const
Definition: PixelID.cxx:907
InDet::SiClusterContainer
Trk::PrepRawDataContainer< SiClusterCollection > SiClusterContainer
Definition: SiClusterContainer.h:26
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
RNGWrapper.h
PixelFastDigitizationTool::m_prdTruthNamePixel
StringProperty m_prdTruthNamePixel
Definition: PixelFastDigitizationTool.h:113
InDetDD::SiCellId
Definition: SiCellId.h:29
InDet::PixelCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:49
Trk::pixelCluster
@ pixelCluster
Definition: MeasurementType.h:22
PixelFastDigitizationTool::m_mergeCluster
bool m_mergeCluster
enable the merging of neighbour Pixel clusters >
Definition: PixelFastDigitizationTool.h:138
DigitizationCell.h
SiHitCollection
AtlasHitsVector< SiHit > SiHitCollection
Definition: SiHitCollection.h:14
PixelFastDigitizationTool::m_pixDiffShiftEndCX
DoubleProperty m_pixDiffShiftEndCX
Definition: PixelFastDigitizationTool.h:134
python.DataFormatRates.c2
c2
Definition: DataFormatRates.py:123
PixelFastDigitizationTool::m_offlineCalibDataKey
SG::ReadCondHandleKey< PixelCalib::PixelOfflineCalibData > m_offlineCalibDataKey
Definition: PixelFastDigitizationTool.h:149
SiClusterContainer.h
InDetDD::SolidStateDetectorElementBase::rawLocalPositionOfCell
Amg::Vector2D rawLocalPositionOfCell(const SiCellId &cellId) const
Returns position (center) of cell.
Definition: SolidStateDetectorElementBase.cxx:230
PixelFastDigitizationTool::m_pixelReadout
ServiceHandle< InDetDD::IPixelReadoutManager > m_pixelReadout
Definition: PixelFastDigitizationTool.h:144
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
y
#define y
TRT::Hit::phiModule
@ phiModule
Definition: HitInfo.h:80
PixelFastDigitizationTool::m_pixelClusterAmbiguitiesMapName
StringProperty m_pixelClusterAmbiguitiesMapName
Definition: PixelFastDigitizationTool.h:141
TimedHitPtr::eventId
unsigned short eventId() const
the index of the component event in PileUpEventInfo.
Definition: TimedHitPtr.h:45
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
PixelModuleDesign.h
InDetDD::PixelModuleDesign::parameters
virtual SiDiodesParameters parameters(const SiCellId &cellId) const
readout or diode id -> position, size
Definition: PixelModuleDesign.cxx:80
PixelFastDigitizationTool::prepareEvent
StatusCode prepareEvent(const EventContext &ctx, unsigned int)
Definition: PixelFastDigitizationTool.cxx:153
PixelFastDigitizationTool::m_pixPrdTruth
PRD_MultiTruthCollection * m_pixPrdTruth
the PRD truth map for Pixel measurements
Definition: PixelFastDigitizationTool.h:114
PlaneSurface.h
GeoPrimitivesHelpers.h
InDetSimDataCollection.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::phiWidth
phiWidth
Definition: RingSetConf_v1.cxx:612
InDet::SiWidth
Definition: SiWidth.h:25
GeoPrimitivesToStringConverter.h
RectangularSegmentation.h
PixelFastDigitizationTool::m_pixSmearPathLength
DoubleProperty m_pixSmearPathLength
the 2.
Definition: PixelFastDigitizationTool.h:124
InDetDD::SiDiodesParameters::width
const SiLocalPosition & width() const
width of the diodes:
Definition: SiDiodesParameters.h:96
physics_parameters.parameters
parameters
Definition: physics_parameters.py:144
PRD_MultiTruthCollection.h
AtlasHitsVector::size
size_type size() const
Definition: AtlasHitsVector.h:143
SubEventIterator
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition: IPileUpTool.h:22
ChangeHistoRange.binsX
list binsX
Definition: ChangeHistoRange.py:56
PixelFastDigitizationTool::m_inputObjectName
StringProperty m_inputObjectName
Definition: PixelFastDigitizationTool.h:118
PixelFastDigitizationTool::m_ambiguitiesMap
InDet::PixelGangedClusterAmbiguities * m_ambiguitiesMap
Definition: PixelFastDigitizationTool.h:142
PixelFastDigitizationTool::m_pixDiffShiftBarrX
DoubleProperty m_pixDiffShiftBarrX
Definition: PixelFastDigitizationTool.h:132
Trk::RectangularSegmentation
Definition: RectangularSegmentation.h:36
PixelFastDigitizationTool::areNeighbours
static bool areNeighbours(const std::vector< Identifier > &group, const Identifier &rdoID, const InDetDD::SiDetectorElement *, const PixelID &pixelID)
Definition: PixelFastDigitizationTool.cxx:882
SiCellId.h
InDetDD::SiDetectorElement::design
virtual const SiDetectorDesign & design() const override final
access to the local description (inline):
PixelID
Definition: PixelID.h:67
PileUpTimeEventIndex
a struct encapsulating the identifier of a pile-up event
Definition: PileUpTimeEventIndex.h:12
PileUpTimeEventIndex::type
PileUpType type() const
the pileup type - minbias, cavern, beam halo, signal?
Definition: PileUpTimeEventIndex.cxx:81
PixelFastDigitizationTool::m_pixSmearLandau
BooleanProperty m_pixSmearLandau
if true : landau else: gauss
Definition: PixelFastDigitizationTool.h:125
InDetDD::SiDetectorElementCollection::getDetectorElement
const SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
Definition: SiDetectorElementCollection.cxx:15
TimedHitCollection< SiHit >
readCCLHist.float
float
Definition: readCCLHist.py:83
SiDetectorDesign.h
InDetDD::SolidStateDetectorElementBase::identify
virtual Identifier identify() const override final
identifier of this detector element (inline)
PixelFastDigitizationTool::createAndStoreRIOs
StatusCode createAndStoreRIOs(const EventContext &ctx)
Definition: PixelFastDigitizationTool.cxx:821
InDet::PixelClusterCollection
Trk::PrepRawDataCollection< PixelCluster > PixelClusterCollection
Definition: PixelClusterCollection.h:26
PixelFastDigitizationTool::Diffuse
static void Diffuse(HepGeom::Point3D< double > &localEntry, HepGeom::Point3D< double > &localExit, double shiftX, double shiftY)
Definition: PixelFastDigitizationTool.cxx:1014
match
bool match(std::string s1, std::string s2)
match the individual directories of two strings
Definition: hcg.cxx:356
fitman.k
k
Definition: fitman.py:528
Identifier
Definition: IdentifierFieldParser.cxx:14
PixelFastDigitizationTool::m_pixelClusterContainer
InDet::PixelClusterContainer * m_pixelClusterContainer
the PixelClusterContainer
Definition: PixelFastDigitizationTool.h:103