er  dev
WCalEvent.cxx
1 /*
2  * WCalEvent.cpp
3  *
4  * Created on: Apr 6, 2017
5  * Author: vratik
6  */
7 
8 #include "WCalEvent.h"
9 
10 WCalEvent::WCalEvent() :
11  fNumOfHits(0)
12 // fEventID(0)
13 {
14  fHits = new TClonesArray("WCalHit", 5);
15 }
16 
17 WCalEvent::~WCalEvent() {
18  Clear();
19 }
20 
21 void WCalEvent::Clear(Option_t * /*option*/)
22 {
23  fHits->Clear("C");
24  fNumOfHits = 0; // Hakuna Matata
25 }
26 
27 //WCalHit* WCalEvent::AddHit(UChar_t p_ch, Float_t p_adcCalib)
28 //{
29 // TClonesArray &hits = *fHits;
32 // return hit;
33 //}
34 
35 WCalHit* WCalEvent::AddHit(UChar_t p_ch, Int_t p_adc, Float_t p_adcNonLin,
36  Float_t p_adcNonLinCorr, Float_t p_adcCalib) {
37 
38  TClonesArray &hits = *fHits;
39 
40 // std::cout << p_adcCalib << std::endl;
41 
42  WCalHit *hit = new(hits[fNumOfHits++]) WCalHit(p_ch, p_adc, p_adcNonLin, p_adcNonLinCorr, p_adcCalib);
43  return hit;
44 }
void Clear(Option_t *t="")
Definition: TLiEvent.cxx:28