ATLAS Offline Software
Loading...
Searching...
No Matches
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
15
16
17// Constructor with parameters:
18SiCharge::SiCharge(const double& charge,const double& time,
19 const Process& processType,const HepMcParticleLink& PL) :
21 m_time(time),
23 m_partLink(PL)
24{}
25
26SiCharge::SiCharge(const double& charge,const double& time,
27 const Process& processType) :
29 m_time(time),
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:
51std::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
double charge(const T &p)
Definition AtlasPID.h:997
std::ostream & operator<<(std::ostream &out, const SiCharge &charge)
Definition SiCharge.cxx:51
double m_time
Definition SiCharge.h:100
Process processType() const
Definition SiCharge.h:119
HepMcParticleLink m_partLink
Definition SiCharge.h:103
double time() const
Definition SiCharge.h:114
Process m_processType
Definition SiCharge.h:101
@ cut_track
Definition SiCharge.h:28
@ cellX_Talk
Definition SiCharge.h:28
@ diodeX_Talk
Definition SiCharge.h:28
@ extraNoise
Definition SiCharge.h:28
bool add(const SiCharge &charge)
Definition SiCharge.cxx:35
double m_charge
Definition SiCharge.h:99
SiCharge(const double &charge, const double &time, const Process &processType, const HepMcParticleLink &PL)
Definition SiCharge.cxx:18
double charge() const
Definition SiCharge.h:109