BmnRoot
Loading...
Searching...
No Matches
BmnECALDigit.cxx
Go to the documentation of this file.
1#include "BmnECALDigit.h"
2#include "TError.h"
3#include <iostream>
4
5using namespace std;
6
7void BmnECALMapElement::SetAdcMap(Int_t chan, ULong_t adcId, UShort_t adcChan) {
8 if (fChan > -1 && fChan != chan) {
9 Error(__func__,"ECAL channel does't match: was %d, become %d, reinitializing", fChan, chan);
10 }
11 fChan = chan;
12 fAdcId = adcId;
13 fAdcChan = adcChan;
14}
15
16void BmnECALMapElement::SetCoeff(Int_t chan, Double_t coeff) {
17 if (fChan > -1 && fChan != chan) {
18 Error(__func__,"ECAL channel does't match: was %d, become %d, reinitializing", fChan, chan);
19 }
20 fChan = chan;
21 fCoeff = coeff;
22}
23
24void BmnECALMapElement::SetCoords(TGeoNode* cell, TGeoNode* mother) {
25 Int_t chan = cell->GetNumber();
26 if (fChan > -1 && fChan != chan) {
27 Fatal(__func__,"ECAL channel does't match: was %d, become %d, fatal!", fChan, chan);
28 }
29 static const Double_t base[] = {0.,0.,0.};
30 cell->LocalToMaster(base, EcalCoords());
31 mother->LocalToMaster(EcalCoords(),LabCoords());
32}
33
35 cout << "Id#"
36 << "\t" << "fAdcChan"
37 << "\t" << "fChan"
38 << "\t" << "fCoeff"
39 << "\t" << "fX"
40 << "\t" << "fY"
41 << "\t" << "fLabX"
42 << "\t" << "fLabY"
43 << "\t" << "fLabZ" << "\n";
44}
45
47 cout << "0x" << std::hex << fAdcId << std::dec
48 << "\t" << fAdcChan
49 << "\t" << fChan
50 << "\t" << fCoeff
51 << "\t" << fX
52 << "\t" << fY
53 << "\t" << fLabX
54 << "\t" << fLabY
55 << "\t" << fLabZ << "\n";
56}
57
59 : BmnCaloDigit()
60{
61 fPeakAmp = 0;
62 fPeakTime = 0;
63 fStartTime = 0;
64 fLabX = fLabY = fLabZ = 0;
65}
66
67BmnECALDigit::BmnECALDigit(Float_t x, Float_t y, UChar_t ch, Float_t amp)
68 : BmnCaloDigit(x, y, ch, amp)
69{
70 fPeakAmp = 0;
71 fPeakTime = 0;
72 fStartTime = 0;
73 fLabX = fLabY = fLabZ = 0;
74}
75
79
80void BmnECALDigit::Set(BmnECALMapElement* e, Float_t amp, Float_t peakAmp, Float_t startTime, Float_t peakTime) {
81 if (e) {
82 fChannel = e->GetChan();
83 fX = e->GetX();
84 fY = e->GetY();
85 fLabX = e->GetLabX();
86 fLabY = e->GetLabY();
87 fLabZ = e->GetLabZ();
88 }
89 fAmp = amp;
90 fPeakAmp = peakAmp;
91 fPeakTime = peakTime;
92 fStartTime = startTime;
93}
UShort_t fChannel
void Set(BmnECALMapElement *e, Float_t amp=0., Float_t peakAmp=0., Float_t startTime=0., Float_t peakTime=0.)
static void PrintTitle()
void SetCoords(TGeoNode *cell, TGeoNode *mother)
void SetCoeff(Int_t chan, Double_t coeff)
Double_t GetLabZ()
Double_t * EcalCoords()
Double_t GetLabY()
void SetAdcMap(Int_t chan, ULong_t adcId, UShort_t adcChan)
Double_t GetLabX()
Double_t * LabCoords()
STL namespace.