SND@LHC Software
Loading...
Searching...
No Matches
ecalCellMC Class Reference

#include <ecalCellMC.h>

Inheritance diagram for ecalCellMC:
Collaboration diagram for ecalCellMC:

Public Member Functions

 ecalCellMC (Int_t cellnumber, Float_t x1=0, Float_t y1=0, Float_t x2=0, Float_t y2=0, Char_t type=0, Float_t energy=0)
 
Float_t GetTrackEnergy (Int_t num) const
 
Float_t GetTrackTime (Int_t num) const
 
void ResetEnergy ()
 
void SetTrackEnergy (Int_t num, Float_t energy, Float_t time=-1111)
 
void AddTrackEnergy (Int_t num, Float_t energy, Float_t time=-1111)
 
Float_t GetTrackClusterEnergy (Int_t num)
 
Int_t TrackEnergySize () const
 
Int_t TrackTimeSize () const
 
void GetTrackEnergySlow (Int_t n, Int_t &trackid, Double_t &energy_dep)
 
void GetTrackTimeSlow (Int_t n, Int_t &trackid, Float_t &time)
 
std::map< Int_t, Float_t >::const_iterator GetTrackEnergyBegin () const
 
std::map< Int_t, Float_t >::const_iterator GetTrackEnergyEnd () const
 
std::map< Int_t, Float_t >::const_iterator GetTrackTimeBegin () const
 
std::map< Int_t, Float_t >::const_iterator GetTrackTimeEnd () const
 
- Public Member Functions inherited from ecalCell
 ecalCell (Int_t cellnumber, Float_t x1=0, Float_t y1=0, Float_t x2=0, Float_t y2=0, Char_t type=0, Float_t energy=0)
 
Bool_t IsInside (Float_t x, Float_t y)
 
Char_t GetType () const
 
Float_t X1 () const
 
Float_t Y1 () const
 
Float_t X2 () const
 
Float_t Y2 () const
 
Float_t GetX1 () const
 
Float_t GetY1 () const
 
Float_t GetX2 () const
 
Float_t GetY2 () const
 
Float_t GetCenterX () const
 
Float_t GetCenterY () const
 
Short_t ADC () const
 
Short_t GetADC () const
 
Int_t GetCellNumber () const
 
Float_t GetEnergy () const
 
Float_t GetTime () const
 
void SetTime (Float_t time)
 
void GetNeighborsList (std::list< ecalCell * > &neib) const
 
void SetNeighborsList (std::list< ecalCell * > &neib)
 
void Get5x5Cluster (std::list< ecalCell * > &cls)
 
void SetEnergy (Float_t energy)
 
void SetADC (Short_t adc)
 
void ResetEnergyFast ()
 
void AddEnergy (Float_t energy)
 
void GetClusterEnergy (Float_t &EcalEnergy)
 
void SetCoord (Float_t x1, Float_t y1, Float_t x2, Float_t y2)
 
void SetType (Char_t type)
 
Int_t CountNeighbors (const std::list< ecalCell * > &lst) const
 

Private Member Functions

 ClassDef (ecalCellMC, 1)
 

Private Attributes

std::map< Int_t, Float_t > fTrackEnergy
 
std::map< Int_t, Float_t > fTrackTime
 

Detailed Description

ecalCellMC.h

Author
Mikhail Prokudin

ECAL cell structure, a part of ECAL module. This implementation carries an MC information

Definition at line 18 of file ecalCellMC.h.

Constructor & Destructor Documentation

◆ ecalCellMC()

ecalCellMC::ecalCellMC ( Int_t  cellnumber,
Float_t  x1 = 0,
Float_t  y1 = 0,
Float_t  x2 = 0,
Float_t  y2 = 0,
Char_t  type = 0,
Float_t  energy = 0 
)

Definition at line 18 of file ecalCellMC.cxx.

19 : ecalCell(cellnumber, x1, y1, x2, y2, type, energy),
22{
23}
std::map< Int_t, Float_t > fTrackTime
Definition ecalCellMC.h:65
std::map< Int_t, Float_t > fTrackEnergy
Definition ecalCellMC.h:62

Member Function Documentation

◆ AddTrackEnergy()

void ecalCellMC::AddTrackEnergy ( Int_t  num,
Float_t  energy,
Float_t  time = -1111 
)
inline

Definition at line 31 of file ecalCellMC.h.

32 {
33 fTrackEnergy[num]+=energy;
34 if (time==-1111) return;
35 std::map<Int_t, Float_t>::const_iterator p=fTrackTime.find(num);
36 if (p==fTrackTime.end()) fTrackTime[num]=time;
37 else
38 if (fTrackTime[num]>time) fTrackTime[num]=time;
39 }

◆ ClassDef()

ecalCellMC::ClassDef ( ecalCellMC  ,
 
)
private

◆ GetTrackClusterEnergy()

Float_t ecalCellMC::GetTrackClusterEnergy ( Int_t  num)

Definition at line 48 of file ecalCellMC.cxx.

49{
50 Float_t energy=GetTrackEnergy(num);
51 list<ecalCell*> cls; GetNeighborsList(cls);
52 list<ecalCell*>::const_iterator p=cls.begin();
53 for(;p!=cls.end();++p)
54 energy+=((ecalCellMC*)(*p))->GetTrackEnergy(num);
55 return energy;
56}
Float_t GetTrackEnergy(Int_t num) const
void GetNeighborsList(std::list< ecalCell * > &neib) const
Definition ecalCell.h:48

◆ GetTrackEnergy()

Float_t ecalCellMC::GetTrackEnergy ( Int_t  num) const

Definition at line 33 of file ecalCellMC.cxx.

34{
35 map<Int_t, Float_t>::const_iterator p=fTrackEnergy.find(num);
36 if (p==fTrackEnergy.end()) return 0; else return p->second;
37}

◆ GetTrackEnergyBegin()

std::map< Int_t, Float_t >::const_iterator ecalCellMC::GetTrackEnergyBegin ( ) const
inline

Definition at line 50 of file ecalCellMC.h.

51 {return fTrackEnergy.begin();}

◆ GetTrackEnergyEnd()

std::map< Int_t, Float_t >::const_iterator ecalCellMC::GetTrackEnergyEnd ( ) const
inline

Definition at line 52 of file ecalCellMC.h.

53 {return fTrackEnergy.end();}

◆ GetTrackEnergySlow()

void ecalCellMC::GetTrackEnergySlow ( Int_t  n,
Int_t &  trackid,
Double_t &  energy_dep 
)

Definition at line 60 of file ecalCellMC.cxx.

61{
62 map<Int_t, Float_t>::const_iterator p=fTrackEnergy.begin();
63 if (n>=fTrackEnergy.size()) {trackid=-1111; energy_dep=-1111; return; }
64 Int_t i=0;
65 for(i=0;i<n;i++) (++p);
66 trackid=p->first; energy_dep=p->second;
67}
int i
Definition ShipAna.py:86

◆ GetTrackTime()

Float_t ecalCellMC::GetTrackTime ( Int_t  num) const

Definition at line 25 of file ecalCellMC.cxx.

26{
27 map<Int_t, Float_t>::const_iterator p=fTrackTime.find(num);
28 if (p==fTrackTime.end()) return 0; else return p->second;
29}

◆ GetTrackTimeBegin()

std::map< Int_t, Float_t >::const_iterator ecalCellMC::GetTrackTimeBegin ( ) const
inline

Definition at line 55 of file ecalCellMC.h.

56 {return fTrackTime.begin();}

◆ GetTrackTimeEnd()

std::map< Int_t, Float_t >::const_iterator ecalCellMC::GetTrackTimeEnd ( ) const
inline

Definition at line 57 of file ecalCellMC.h.

58 {return fTrackTime.end();}

◆ GetTrackTimeSlow()

void ecalCellMC::GetTrackTimeSlow ( Int_t  n,
Int_t &  trackid,
Float_t &  time 
)

Definition at line 71 of file ecalCellMC.cxx.

72{
73 map<Int_t, Float_t>::const_iterator p=fTrackTime.begin();
74 if (n>=fTrackTime.size()) {trackid=-1111; time=-1111; return; }
75 Int_t i=0;
76 for(i=0;i<n;i++) (++p);
77 trackid=p->first; time=p->second;
78}

◆ ResetEnergy()

void ecalCellMC::ResetEnergy ( )

Reset all energies in cell

Definition at line 40 of file ecalCellMC.cxx.

41{
43 fTrackEnergy.clear();
44 fTrackTime.clear();
45}
void ResetEnergyFast()
Definition ecalCell.h:109

◆ SetTrackEnergy()

void ecalCellMC::SetTrackEnergy ( Int_t  num,
Float_t  energy,
Float_t  time = -1111 
)
inline

Definition at line 29 of file ecalCellMC.h.

30 {fTrackEnergy[num]=energy; fTrackTime[num]=time; }

◆ TrackEnergySize()

Int_t ecalCellMC::TrackEnergySize ( ) const
inline

Definition at line 44 of file ecalCellMC.h.

44{return fTrackEnergy.size();}

◆ TrackTimeSize()

Int_t ecalCellMC::TrackTimeSize ( ) const
inline

Definition at line 45 of file ecalCellMC.h.

45{return fTrackEnergy.size();}

Member Data Documentation

◆ fTrackEnergy

std::map<Int_t, Float_t> ecalCellMC::fTrackEnergy
private

map<TrackId, Energy in ECAL>

Definition at line 62 of file ecalCellMC.h.

◆ fTrackTime

std::map<Int_t, Float_t> ecalCellMC::fTrackTime
private

map<TrackId, Time in ECAL>

Definition at line 65 of file ecalCellMC.h.


The documentation for this class was generated from the following files: