ATLAS Offline Software
SiCharge.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // SiCharge.cxx
7 // Implementation file for class SiCharge
9 // (c) ATLAS Detector software
11 // Version 1.4 08/06/2001 David Calvet
13 
14 #include "InDetSimEvent/SiCharge.h"
15 
16 
17 // Constructor with parameters:
18 SiCharge::SiCharge(const double& charge,const double& time,
19  const Process& processType,const HepMcParticleLink& PL) :
20  m_charge(charge),
21  m_time(time),
22  m_processType(processType),
23  m_partLink(PL)
24 {}
25 
26 SiCharge::SiCharge(const double& charge,const double& time,
27  const Process& processType) :
28  m_charge(charge),
29  m_time(time),
30  m_processType(processType),
31  m_partLink()
32 {}
33 
34 // add another charge, if the process and track are the same:
36 {
37  // check if the two charges are compatible
38  if (charge.m_processType!=m_processType ||
39  charge.m_time!=m_time ||
40  charge.m_partLink!=m_partLink) {
41  return false;
42  } else {
43  m_charge+=charge.m_charge;
44  return true;
45  }
46 }
47 
49 // Input/Output stream functions:
51 std::ostream &operator<<(std::ostream &out,const SiCharge &charge)
52 {
53  out << "Charge=" << charge.charge() << " Time=" << charge.time()
54  << " Process=";
55  if (charge.processType()==SiCharge::no) out << "no";
56  else if (charge.processType()==SiCharge::track) out << "track";
57  else if (charge.processType()==SiCharge::diodeX_Talk) out << "diodeX_Talk";
58  else if (charge.processType()==SiCharge::cellX_Talk) out << "cellX_Talk";
59  else if (charge.processType()==SiCharge::noise) out << "noise";
60  else if (charge.processType()==SiCharge::extraNoise) out << "extraNoise";
61  else if (charge.processType()==SiCharge::cut_track) out << "cut_track";
62  else out << "UNKNOWN !";
63  return (out << " Barcode=" << charge.trackBarcode());
64 }
65 
SiCharge::charge
double charge() const
Definition: SiCharge.h:109
SiCharge::m_charge
double m_charge
Definition: SiCharge.h:99
SiCharge::m_processType
Process m_processType
Definition: SiCharge.h:101
SiCharge::track
@ track
Definition: SiCharge.h:28
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
SiCharge
Definition: SiCharge.h:25
SiCharge::diodeX_Talk
@ diodeX_Talk
Definition: SiCharge.h:28
operator<<
std::ostream & operator<<(std::ostream &out, const SiCharge &charge)
Definition: SiCharge.cxx:51
SiCharge::extraNoise
@ extraNoise
Definition: SiCharge.h:28
SiCharge::noise
@ noise
Definition: SiCharge.h:28
SiCharge::m_time
double m_time
Definition: SiCharge.h:100
SiCharge::SiCharge
SiCharge()
SiCharge::add
bool add(const SiCharge &charge)
Definition: SiCharge.cxx:35
SiCharge::m_partLink
HepMcParticleLink m_partLink
Definition: SiCharge.h:103
runSelector.processType
processType
Definition: runSelector.py:225
charge
double charge(const T &p)
Definition: AtlasPID.h:756
SiCharge::Process
Process
Definition: SiCharge.h:28
SiCharge::cut_track
@ cut_track
Definition: SiCharge.h:28
SiCharge.h
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
SiCharge::no
@ no
Definition: SiCharge.h:28
SiCharge::cellX_Talk
@ cellX_Talk
Definition: SiCharge.h:28