ATLAS Offline Software
ALFA_PileUpTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ALFA_PILEUP_TOOL_H
6 #define ALFA_PILEUP_TOOL_H
7 
9 
10 #include "Gaudi/Property.h"
11 #include "GaudiKernel/ServiceHandle.h"
12 #include "GaudiKernel/ITHistSvc.h"
14 
16 
19 
22 
24 
25 #include <string>
26 #include <iostream>
27 #include <fstream>
28 
29 #include <vector>
30 #include <utility> /* pair */
31 
32 namespace CLHEP {
33  class HepRandomEngine;
34 }
35 
37 
38  public:
39 
40  ALFA_PileUpTool(const std::string& type,
41  const std::string& name,
42  const IInterface* parent);
43 
44  virtual StatusCode initialize() override final;
45  virtual StatusCode finalize() override final;
46 
49  virtual StatusCode prepareEvent(const EventContext& ctx, const unsigned int nInputEvents) override final;
50 
53  int bunchXing,
54  SubEventIterator bSubEvents,
55  SubEventIterator eSubEvents
56  ) override final;
59  // virtual bool toProcess(int bunchXing) const;
60 
62  virtual StatusCode mergeEvent(const EventContext& ctx) override final;
63 
64  virtual StatusCode processAllSubEvents(const EventContext& ctx) override final;
65 
66  private:
67 
68  /*
69  StatusCode recordContainers(ServiceHandle<StoreGateSvc>& evtStore, std::string m_key_digitCnt);
70 
71  void fillStripDigitContainer(const ZDC_SimStripHit_Collection*, CLHEP::HepRandomEngine*);
72  void fillStripDigitContainer(TimedHitCollection<ZDC_SimStripHit>&, CLHEP::HepRandomEngine*);
73 
74  void fillPixelDigitContainer(const ZDC_SimPixelHit_Collection*, CLHEP::HepRandomEngine*);
75  void fillPixelDigitContainer(TimedHitCollection<ZDC_SimPixelHit>&, CLHEP::HepRandomEngine*);
76 
77  void createAndStoreStripDigit(int Side, int ModuleNo, int NPhotons, CLHEP::HepRandomEngine* rndEngine);
78  void createAndStorePixelDigit(int Side, int ModuleNo, int PixNum, int NPhotons, CLHEP::HepRandomEngine* rndEngine);
79 
80  */
81 
82  //StatusCode Truth_info();
83 
84  StatusCode recordCollection(ServiceHandle<StoreGateSvc>& evtStore, const std::string& key_digitCnt);
85  //StatusCode fillDigitCollection();
86 
87  void ALFA_MD_info(const ALFA_HitCollection*);
89 
90  //void fillDigitCollection(const ALFA_HitCollection*, CLHEP::HepRandomEngine*);
91  //void fillDigitCollection(TimedHitCollection<ALFA_Hit>&, CLHEP::HepRandomEngine*);
92 
93  StatusCode fill_MD_DigitCollection(CLHEP::HepRandomEngine*);
94 
95  StatusCode recordODCollection(ServiceHandle<StoreGateSvc>& evtStore, const std::string& key_ODdigitCnt);
96  //StatusCode fillODDigitCollection();
97 
100 
101  //void fillDigitODCollection(const ALFA_ODHitCollection*, CLHEP::HepRandomEngine*);
102  //void fillDigitODCollection(TimedHitCollection<ALFA_ODHit>&, CLHEP::HepRandomEngine*);
103 
104  StatusCode fill_OD_DigitCollection(CLHEP::HepRandomEngine*);
105  StatusCode XTalk();
106 
107  /*
108  void SetDumps(bool, bool);
109  */
110 
111  ServiceHandle<PileUpMergeSvc> m_mergeSvc{this, "mergeSvc", "PileUpMergeSvc", ""};
112  ServiceHandle<IAthRNGSvc> m_randomSvc{this, "RndmSvc", "AthRNGSvc", ""};
113  Gaudi::Property<std::string> m_randomStreamName{this, "RandomStreamName", "ALFARndEng", ""};
114 
115  double m_E_fib[8][20][64];
116  double m_E_ODfib[8][2][3][30];
117 
118  /*
119  std::string m_SimStripHitCollectionName;
120  std::string m_SimPixelHitCollectionName;
121  std::string m_ZdcDigitsContainerName;
122  */
123 
128 
129 
131 
133 
134  /*
135  double m_ScaleStrip, m_ScalePixel; // use this to normalize the signal from the strips;
136  int m_Pedestal; // Pedestal=40 ;RMS=3??(ask Andrei about this)
137  int m_MaxTimeBin; // The number of time-slices after digitization(Typically 5 or 7)
138  double m_SigmaNoiseHG_Strip, m_SigmaNoiseHG_Pixel, m_SigmaNoiseLG_Strip, m_SigmaNoiseLG_Pixel;
139  bool m_DumpStrip, m_DumpPixel;
140 
141  */
142 
143  double m_sigma0;
144  double m_sigma1;
145  double m_meanE_dep;
146  double m_meanN_photo;
147  double m_mean;
148  double m_stdDev;
149  double m_AmplitudeCut;
150 
151  /*
152  ZDC_SimStripHit_Collection *m_mergedStripHitList;
153  ZDC_SimPixelHit_Collection *m_mergedPixelHitList;
154 
155  std::ofstream MyFile;
156  ZdcDigitsCollection *m_digitContainer;
157  */
158 
161 
162  double m_cross_talk[8][127];
163  int m_fibres[8][20][64];
164 
165  std::ifstream m_fXTalk;
166  std::stringstream m_s;
167  std::string m_filename;
168 
169 };
170 
171 #endif
ALFA_PileUpTool::m_fibres
int m_fibres[8][20][64]
Definition: ALFA_PileUpTool.h:163
ALFA_PileUpTool::ALFA_MD_info
void ALFA_MD_info(const ALFA_HitCollection *)
Definition: ALFA_PileUpTool.cxx:399
ALFA_ODDigitCollection.h
ALFA_PileUpTool::processBunchXing
virtual StatusCode processBunchXing(int bunchXing, SubEventIterator bSubEvents, SubEventIterator eSubEvents) override final
called for each active bunch-crossing to process current SubEvents bunchXing is in ns
Definition: ALFA_PileUpTool.cxx:243
ALFA_PileUpTool::m_meanN_photo
double m_meanN_photo
Definition: ALFA_PileUpTool.h:146
ALFA_PileUpTool::m_key_ODDigitCollection
std::string m_key_ODDigitCollection
Definition: ALFA_PileUpTool.h:127
AtlasHitsVector
Definition: AtlasHitsVector.h:33
ALFA_ODHitCollection.h
ALFA_PileUpTool::ALFA_OD_info
void ALFA_OD_info(const ALFA_ODHitCollection *)
Definition: ALFA_PileUpTool.cxx:490
ALFA_PileUpTool
Definition: ALFA_PileUpTool.h:36
ALFA_PileUpTool::m_filename
std::string m_filename
Definition: ALFA_PileUpTool.h:167
ALFA_PileUpTool::m_AmplitudeCut
double m_AmplitudeCut
Definition: ALFA_PileUpTool.h:149
ALFA_PileUpTool::initialize
virtual StatusCode initialize() override final
Definition: ALFA_PileUpTool.cxx:93
ALFA_PileUpTool::m_mergedALFA_HitList
ALFA_HitCollection * m_mergedALFA_HitList
Definition: ALFA_PileUpTool.h:159
ALFA_PileUpTool::m_randomStreamName
Gaudi::Property< std::string > m_randomStreamName
Definition: ALFA_PileUpTool.h:113
ALFA_PileUpTool::m_ODdigitCollection
ALFA_ODDigitCollection * m_ODdigitCollection
Definition: ALFA_PileUpTool.h:132
ALFA_PileUpTool::recordCollection
StatusCode recordCollection(ServiceHandle< StoreGateSvc > &evtStore, const std::string &key_digitCnt)
Definition: ALFA_PileUpTool.cxx:329
ALFA_PileUpTool::m_meanE_dep
double m_meanE_dep
Definition: ALFA_PileUpTool.h:145
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ALFA_PileUpTool::fill_OD_DigitCollection
StatusCode fill_OD_DigitCollection(CLHEP::HepRandomEngine *)
Definition: ALFA_PileUpTool.cxx:628
ALFA_PileUpTool::m_SimODHitCollectionName
std::string m_SimODHitCollectionName
Definition: ALFA_PileUpTool.h:125
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
ALFA_PileUpTool::m_E_ODfib
double m_E_ODfib[8][2][3][30]
Definition: ALFA_PileUpTool.h:116
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TimedHitCollection.h
ALFA_DigitCollection.h
ALFA_PileUpTool::m_E_fib
double m_E_fib[8][20][64]
Definition: ALFA_PileUpTool.h:115
PileUpToolBase
Definition: PileUpToolBase.h:18
ALFA_PileUpTool::processAllSubEvents
virtual StatusCode processAllSubEvents(const EventContext &ctx) override final
Definition: ALFA_PileUpTool.cxx:116
ALFA_PileUpTool::m_s
std::stringstream m_s
Definition: ALFA_PileUpTool.h:166
ALFA_PileUpTool::recordODCollection
StatusCode recordODCollection(ServiceHandle< StoreGateSvc > &evtStore, const std::string &key_ODdigitCnt)
Definition: ALFA_PileUpTool.cxx:341
ALFA_PileUpTool::m_mergedALFA_ODHitList
ALFA_ODHitCollection * m_mergedALFA_ODHitList
Definition: ALFA_PileUpTool.h:160
ALFA_PileUpTool::m_sigma0
double m_sigma0
Definition: ALFA_PileUpTool.h:143
ALFA_DigitCollection
Definition: ALFA_DigitCollection.h:15
ALFA_PileUpTool::XTalk
StatusCode XTalk()
Definition: ALFA_PileUpTool.cxx:675
ALFA_PileUpTool::m_sigma1
double m_sigma1
Definition: ALFA_PileUpTool.h:144
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ALFA_PileUpTool::m_SimHitCollectionName
std::string m_SimHitCollectionName
Definition: ALFA_PileUpTool.h:124
ALFA_PileUpTool::finalize
virtual StatusCode finalize() override final
Definition: ALFA_PileUpTool.cxx:325
ALFA_PileUpTool::m_cross_talk
double m_cross_talk[8][127]
Definition: ALFA_PileUpTool.h:162
ALFA_PileUpTool::m_mergeSvc
ServiceHandle< PileUpMergeSvc > m_mergeSvc
Definition: ALFA_PileUpTool.h:111
ALFA_PileUpTool::m_key_DigitCollection
std::string m_key_DigitCollection
Definition: ALFA_PileUpTool.h:126
ALFA_PileUpTool::m_fXTalk
std::ifstream m_fXTalk
Definition: ALFA_PileUpTool.h:165
ALFA_PileUpTool::prepareEvent
virtual StatusCode prepareEvent(const EventContext &ctx, const unsigned int nInputEvents) override final
code taken from ZDC; author (highly) probably John Chapman called before the subevts loop.
Definition: ALFA_PileUpTool.cxx:222
ALFA_HitCollection.h
PileUpMergeSvc.h
the preferred mechanism to access information from the different event stores in a pileup job.
ALFA_PileUpTool::ALFA_PileUpTool
ALFA_PileUpTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: ALFA_PileUpTool.cxx:49
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ALFA_PileUpTool::m_digitCollection
ALFA_DigitCollection * m_digitCollection
Definition: ALFA_PileUpTool.h:130
SubEventIterator
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition: IPileUpTool.h:22
ALFA_PileUpTool::m_mean
double m_mean
Definition: ALFA_PileUpTool.h:147
PileUpToolBase.h
helper base class IPileUpTool::toProcess().
ALFA_PileUpTool::mergeEvent
virtual StatusCode mergeEvent(const EventContext &ctx) override final
return false if not interested in certain xing times (in ns) implemented by default in PileUpToolBase...
Definition: ALFA_PileUpTool.cxx:298
ALFA_PileUpTool::fill_MD_DigitCollection
StatusCode fill_MD_DigitCollection(CLHEP::HepRandomEngine *)
Definition: ALFA_PileUpTool.cxx:536
ALFA_PileUpTool::m_randomSvc
ServiceHandle< IAthRNGSvc > m_randomSvc
Definition: ALFA_PileUpTool.h:112
TimedHitCollection
Definition: TimedHitCollection.h:15
ALFA_PileUpTool::m_stdDev
double m_stdDev
Definition: ALFA_PileUpTool.h:148
IAthRNGSvc.h
ServiceHandle< StoreGateSvc >
ALFA_ODDigitCollection
Definition: ALFA_ODDigitCollection.h:15