CMS 3D CMS Logo

HcalForwardAnalysis.h
Go to the documentation of this file.
1 #ifndef ShowerLibraryProducer_HcalForwardAnalysis_h
2 #define ShowerLibraryProducer_HcalForwardAnalysis_h
3 
4 #include <iostream>
5 #include <memory>
6 #include <vector>
7 #include <string>
8 
9 // user include files
12 
15 
18 
19 #include "G4Step.hh"
20 #include "G4Track.hh"
21 #include "G4ThreeVector.hh"
22 
23 #include "TFile.h"
24 #include "TTree.h"
25 
26 #include <vector>
27 #include <string>
28 
29 class BeginOfRun;
30 class BeginOfEvent;
31 class EndOfEvent;
32 
34  public Observer<const BeginOfRun*>,
35  public Observer<const BeginOfEvent*>,
36  public Observer<const EndOfEvent*>,
37  public Observer<const G4Step*> {
38 public:
39  struct Photon {
40  Photon(int id, float X, float Y, float Z, float T, float Lambda)
41  : fiberId(id), x(X), y(Y), z(Z), t(T), lambda(Lambda) {}
42  int fiberId;
43  float x;
44  float y;
45  float z;
46  float t;
47  float lambda;
48  };
49 
51  ~HcalForwardAnalysis() override;
52 
53  void produce(edm::Event&, const edm::EventSetup&) override;
54 
55 private:
56  HcalForwardAnalysis(const HcalForwardAnalysis&) = delete; // stop default
57  const HcalForwardAnalysis& operator=(const HcalForwardAnalysis&) = delete;
58 
59  void init();
60 
61  // observer methods
62  void update(const BeginOfRun* run) override;
63  void update(const BeginOfEvent* evt) override;
64  void update(const G4Step* step) override;
65  void update(const EndOfEvent* evt) override;
66  // void write(const EndOfRun * run);
67 
68  //User methods
69  void setPhotons(const EndOfEvent* evt);
70  //void fillEvent(PHcalForwardLibInfo&);
71  void fillEvent();
72  void parseDetId(int id, int& tower, int& cell, int& fiber);
73  void clear();
75  //TFile * theFile;
76  TTree* theTree;
78  int count;
79  int evNum;
80  float x[10000], y[10000], z[10000], t[10000], lambda[10000];
81  float primX, primY, primZ, primT;
83  int nphot;
84  int fiberId[10000];
85  std::vector<Photon> thePhotons;
86  std::vector<std::string> theNames;
87 };
88 #endif
HcalForwardAnalysis::y
float y[10000]
Definition: HcalForwardAnalysis.h:80
HcalForwardAnalysis::primY
float primY
Definition: HcalForwardAnalysis.h:81
Observer
Definition: Observer.h:23
step
step
Definition: StallMonitor.cc:94
X
#define X(str)
Definition: MuonsGrabber.cc:38
HcalForwardAnalysis::primMomZ
float primMomZ
Definition: HcalForwardAnalysis.h:82
HcalForwardAnalysis::t
float t[10000]
Definition: HcalForwardAnalysis.h:80
SimProducer.h
HcalForwardAnalysis::thePhotons
std::vector< Photon > thePhotons
Definition: HcalForwardAnalysis.h:85
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HFShowerG4Hit.h
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:3
HcalForwardAnalysis::primX
float primX
Definition: HcalForwardAnalysis.h:81
HcalForwardAnalysis::setPhotons
void setPhotons(const EndOfEvent *evt)
Definition: HcalForwardAnalysis.cc:118
HcalForwardAnalysis::init
void init()
Definition: HcalForwardAnalysis.cc:64
HcalForwardAnalysis::parseDetId
void parseDetId(int id, int &tower, int &cell, int &fiber)
Definition: HcalForwardAnalysis.cc:242
HcalForwardAnalysis::Photon::fiberId
int fiberId
Definition: HcalForwardAnalysis.h:42
HcalForwardAnalysis::Photon::z
float z
Definition: HcalForwardAnalysis.h:45
BPhysicsValidation_cfi.Lambda
Lambda
Definition: BPhysicsValidation_cfi.py:63
HcalForwardAnalysis::x
float x[10000]
Definition: HcalForwardAnalysis.h:80
Observer.h
HcalForwardAnalysis::theEventCounter
int theEventCounter
Definition: HcalForwardAnalysis.h:77
HcalForwardAnalysis::Photon::Photon
Photon(int id, float X, float Y, float Z, float T, float Lambda)
Definition: HcalForwardAnalysis.h:40
HcalForwardAnalysis::evNum
int evNum
Definition: HcalForwardAnalysis.h:79
Service.h
FiberG4Hit.h
HcalForwardAnalysis::lambda
float lambda[10000]
Definition: HcalForwardAnalysis.h:80
EndOfEvent
Definition: EndOfEvent.h:6
HcalForwardAnalysis::primZ
float primZ
Definition: HcalForwardAnalysis.h:81
HcalForwardAnalysis::nphot
int nphot
Definition: HcalForwardAnalysis.h:83
TFileService.h
HcalForwardAnalysis::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: HcalForwardAnalysis.cc:53
HcalForwardAnalysis::z
float z[10000]
Definition: HcalForwardAnalysis.h:80
HcalForwardAnalysis::theFile
edm::Service< TFileService > theFile
Definition: HcalForwardAnalysis.h:74
HcalForwardAnalysis::count
int count
Definition: HcalForwardAnalysis.h:78
edm::ParameterSet
Definition: ParameterSet.h:36
HcalForwardAnalysis::Photon::y
float y
Definition: HcalForwardAnalysis.h:44
HcalForwardAnalysis::theTree
TTree * theTree
Definition: HcalForwardAnalysis.h:76
SimProducer
Definition: SimProducer.h:64
Photon
Definition: Photon.py:1
edm::Service< TFileService >
DOFs::Z
Definition: AlignPCLThresholdsWriter.cc:37
HcalForwardAnalysis::Photon::lambda
float lambda
Definition: HcalForwardAnalysis.h:47
BeginOfEvent
Definition: BeginOfEvent.h:6
BeginOfRun
Definition: BeginOfRun.h:6
edm::EventSetup
Definition: EventSetup.h:57
HcalForwardAnalysis
Definition: HcalForwardAnalysis.h:33
HcalForwardAnalysis::primMomY
float primMomY
Definition: HcalForwardAnalysis.h:82
HcalForwardAnalysis::Photon::x
float x
Definition: HcalForwardAnalysis.h:43
writedatasetfile.run
run
Definition: writedatasetfile.py:27
DOFs::Y
Definition: AlignPCLThresholdsWriter.cc:37
HcalForwardAnalysis::fillEvent
void fillEvent()
Definition: HcalForwardAnalysis.cc:227
HcalForwardAnalysis::operator=
const HcalForwardAnalysis & operator=(const HcalForwardAnalysis &)=delete
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
T
long double T
Definition: Basic3DVectorLD.h:48
HcalForwardAnalysis::primT
float primT
Definition: HcalForwardAnalysis.h:81
HcalForwardAnalysis::~HcalForwardAnalysis
~HcalForwardAnalysis() override
Definition: HcalForwardAnalysis.cc:47
HcalForwardAnalysis::primMomX
float primMomX
Definition: HcalForwardAnalysis.h:82
HcalForwardAnalysis::fiberId
int fiberId[10000]
Definition: HcalForwardAnalysis.h:84
HcalForwardAnalysis::theNames
std::vector< std::string > theNames
Definition: HcalForwardAnalysis.h:86
HcalForwardAnalysis::clear
void clear()
Definition: HcalForwardAnalysis.cc:248
edm::Event
Definition: Event.h:73
HcalForwardAnalysis::update
void update(const BeginOfRun *run) override
This routine will be called when the appropriate signal arrives.
Definition: HcalForwardAnalysis.cc:87
HcalForwardAnalysis::Photon::t
float t
Definition: HcalForwardAnalysis.h:46
HcalForwardAnalysis::HcalForwardAnalysis
HcalForwardAnalysis(const edm::ParameterSet &p)
Definition: HcalForwardAnalysis.cc:27