50 "Name of the output stream" );
94 return StatusCode::SUCCESS;
99 return StatusCode::SUCCESS;
106 const char *treeName=
"simhits";
125 return StatusCode::SUCCESS;
134 if (mdtHits.
isValid() && mdtHits->size()) {
136 while ( ih!=mdtHits->end()) {
138 m_id = (*ih).MDTid();
139 m_mother = (*ih).particleEncoding();
140 m_time = (*ih).globalTime();
148 while (ih!=mdtHits->end() &&
m_id==(*ih).MDTid() &&
m_barcode==(*ih).truthBarcode() ) {
158 if (rpcHits.
isValid() && rpcHits->size()) {
160 while (ih!=rpcHits->end()) {
162 m_id = (*ih).RPCid();
163 m_mother = (*ih).particleEncoding();
164 m_time = (*ih).globalTime();
172 while (ih!=rpcHits->end() &&
m_id==(*ih).RPCid() &&
m_barcode==(*ih).truthBarcode() ) {
182 if (tgcHits.
isValid() && tgcHits->size()) {
184 while ( ih!=tgcHits->end()) {
186 m_id = (*ih).TGCid();
187 m_mother = (*ih).particleEncoding();
188 m_time = (*ih).globalTime();
196 while (ih!=tgcHits->end() &&
m_id==(*ih).TGCid() &&
m_barcode==(*ih).truthBarcode() ) {
206 if (cscHits.
isValid() && cscHits->size()) {
208 while ( ih!=cscHits->end()) {
210 m_id = (*ih).CSCid();
212 m_time = (*ih).globalTime();
220 while (ih!=cscHits->end() &&
m_id==(*ih).CSCid() &&
m_barcode==(*ih).truthBarcode() ) {
229 for (
int ipileup=0;ipileup<2;ipileup++) {
233 if (pixHits.
isValid() && pixHits->size()) {
235 while (ih!=pixHits->end()) {
237 m_id = (*ih).identify();
241 m_time = (*ih).meanTime();
248 while (ih!=pixHits->end() && ((
unsigned int)
m_id)==(*ih).identify() &&
m_barcode==(*ih).truthBarcode() ) {
258 if (sctHits.
isValid() && sctHits->size()) {
260 while (ih!=sctHits->end()) {
262 m_id = (*ih).identify();
266 m_time = (*ih).meanTime();
273 while (ih!=sctHits->end() && ((
unsigned int)
m_id)==(*ih).identify() &&
m_barcode==(*ih).truthBarcode() ) {
283 if (trtHits.
isValid() && trtHits->size()) {
285 while ( ih!=trtHits->end()) {
287 m_id = (*ih).GetHitID();
288 m_mother = (*ih).GetParticleEncoding();
290 m_time = (*ih).GetGlobalTime();
297 while (ih!=trtHits->end() &&
m_id==(*ih).GetHitID() &&
m_barcode==(*ih).truthBarcode() ) {
306 return StatusCode::SUCCESS;
312 auto t_mom=(HMPL.
cptr())->momentum();
313 m_momentum = std::sqrt( t_mom.x()*t_mom.x()+t_mom.y()*t_mom.y()+t_mom.z()*t_mom.z());
#define ATH_CHECK
Evaluate an expression and check for errors.
Handle class for reading from StoreGate.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
CONT::const_iterator const_iterator
a link optimized in size for a GenParticle in a McEventCollection
bool isValid() const
Validity check.
HepMC::ConstGenParticlePtr cptr() const
Dereference.
virtual ~SimHitTreeCreator()
Destructor.
StatusCode fillSimHitsTree()
Fill the simhits tree - validation mode only.
SG::ReadHandleKey< SiHitCollection > m_bcmHits
virtual StatusCode execute() override final
Athena algorithm's interface method execute()
SG::ReadHandleKey< SiHitCollection > m_blmHits
SG::ReadHandleKey< TGCSimHitCollection > m_tgcHits
virtual StatusCode initialize() override final
Athena algorithm's interface method initialize()
SG::ReadHandleKey< RPCSimHitCollection > m_rpcHits
SG::ReadHandleKey< SiHitCollection > m_sctHits
std::string m_validationStream
validation THist stream name
SG::ReadHandleKey< MDTSimHitCollection > m_mdtHits
SG::ReadHandleKey< TRTUncompressedHitCollection > m_trtPileupHits
SimHitTreeCreator(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters.
SG::ReadHandleKey< SiHitCollection > m_pixPileupHits
SG::ReadHandleKey< SiHitCollection > m_pixHits
SG::ReadHandleKey< TRTUncompressedHitCollection > m_trtHits
ServiceHandle< ITHistSvc > m_thistSvc
the histogram service
SG::ReadHandleKey< SiHitCollection > m_sctPileupHits
SG::ReadHandleKey< CSCSimHitCollection > m_cscHits
StatusCode createSimHitsTree()
Create the simhits tree - validation mode only.
TTree * m_t_simHits
Validation output TTree (+variables)
void addHepMcParticleLinkInfoToTree(HepMcParticleLink &HMPL)
virtual bool isValid() override final
Can the handle be successfully dereferenced?