File: clonesA_Event.cxx

package info (click to toggle)
root-system 5.34.00-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 190,532 kB
  • sloc: cpp: 1,401,904; ansic: 217,182; xml: 25,899; sh: 19,215; fortran: 12,570; python: 7,311; makefile: 7,216; ruby: 553; csh: 317; objc: 88; perl: 85; sql: 14; tcl: 4
file content (70 lines) | stat: -rw-r--r-- 1,779 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include "TFile.h"
#include "TClonesArray.h"
#include "clonesA_Event.h"

ClassImp(TUsrHit)
    ClassImp(TUsrHitBuffer)
    ClassImp(TUsrSevtData1)
    ClassImp(TUsrSevtData2)
    ClassImp(TMrbSubevent_Caen)

//______________________________________________________
   TUsrHit::TUsrHit(Int_t ev) {
   fEventNumber = ev;
   fModuleNumber = ev%4;
   fChannel  = ev+1000;
   for (Int_t i=0;i<3;i++) fEventTime[i] = 100+ev;  
}

//______________________________________________________

TUsrHitBuffer::TUsrHitBuffer(Int_t maxent) {
   fNofEntries = maxent;
   fNofHits = 0;
   fHits = new TClonesArray("TUsrHit", fNofEntries);
   cout << "ctor TUsrHitBuffer " << this << endl;
}

//______________________________________________________

TUsrHit *TUsrHitBuffer::AddHit(Int_t ev) {
   TClonesArray & hits = *fHits;
   TUsrHit *hit = new(hits[fNofHits++]) TUsrHit(ev);
   return hit;
}

//______________________________________________________

void TUsrHitBuffer::Clear(Option_t *) {
   fHits->Clear();
   fNofHits = 0;
}

//______________________________________________________

void TUsrSevtData1::SetEvent(Int_t ev) {
   Clear();
   cout << "TUsrSevtData1: " << ev << endl;
   fTimeStamp = 100+ev; //in TMrbSubevent_Caen
   fSevtName  = "SubEvent_1_";
   fSevtName += ev;
   fMer       = 1100 + ev;
   fPileup    = 2100 + ev;
   for(Int_t i = 1; i <= ev+1; i++) {
      fHitBuffer.AddHit(i);
   }
}
//______________________________________________________

void TUsrSevtData2::SetEvent(Int_t ev) {
   Clear();
   cout << "TUsrSevtData2: " << ev << endl;
   fTimeStamp = 100+ev; //in TMrbSubevent_Caen
   fSevtName  = "SubEvent_2_";
   fSevtName += ev;
   fMer       = 21000 + ev;
   fPileup    = 22000 + ev;
   for(Int_t i = 1; i <= ev+1; i++) {
      fHitBuffer.AddHit(i);
   }
}