forked from h2gglobe/h2gglobe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PhotonReducedInfo.h
81 lines (63 loc) · 2.75 KB
/
PhotonReducedInfo.h
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
71
72
73
74
75
76
77
78
79
#ifndef PhotonReducedInfo_h
#define PhotonReducedInfo_h
#include "TVector3.h"
#include "TLorentzVector.h"
#include <iostream>
#include "BaseSmearer.h"
class PhotonReducedInfo
{
public:
// PhotonReducedInfo();
PhotonReducedInfo(const TVector3 & caloPosition, float energy, float corrEnergy, int iDet, float r9, int ipho, bool passId, float corrEnergyErr=0);
// PhotonReducedInfo(const PhotonReducedInfo &obj){copy_(obj);}
// PhotonReducedInfo & operator= (const PhotonReducedInfo &obj);
const TVector3 & caloPosition() const { return caloPosition_; }
int iDet() const {return iDet_;}
int iPho() const {return iPho_;}
float energy() const { return energy_; }
float corrEnergy() const { return corrEnergy_; }
float corrEnergyErr() const { return corrEnergyErr_; }
float rawCorrEnergyErr() const { return rawCorrEnergyErr_; }
float r9() const { return r9_; }
bool passId() const { return passId_; }
bool isSphericalPhoton() const { return sphericalPhoton_; }
TLorentzVector p4(float vtxx, float vtxy, float vtxz) const;
void setEnergy(float energy) {energy_=energy; };
void setCorrEnergy(float corrEnergy) {corrEnergy_=corrEnergy; };
void setCorrEnergyErr(float corrEnergyErr) {corrEnergyErr_=corrEnergyErr; };
void setCaloPosition(const TVector3 & caloPosition) { caloPosition_=caloPosition; };
void setR9(float r9) {r9_=r9; };
void setDet(int det) { iDet_=det; };
void setSphericalPhoton(bool issph){sphericalPhoton_= issph;};
unsigned int nSmearingSeeds() { return smearingSeeds_.size(); }
int smearingSeed(int ised=0) { return smearingSeeds_[ised]; };
void addSmearingSeed(int seed) { return smearingSeeds_.push_back(seed); };
void dump();
void reset();
void cacheVal(int id, const BaseSmearer * smearer, float val) {
cache_.resize(BaseSmearer::nRegisteredSmerers(),std::make_pair((const BaseSmearer *)0,0.));
cache_[id] = std::make_pair(smearer,val);
};
bool hasCachedVal(int id) { return cache_.size() > id && cache_[id].first != 0; };
const std::pair<const BaseSmearer *, float> & cachedVal(int id) { return cache_[id]; };
void dumpCache() {
std::cout << "Photon " << this;
for(std::vector<std::pair<const BaseSmearer *, float> >::iterator it=cache_.begin(); it!=cache_.end(); ++it) {
std::cout << "\n " << (it->first == 0 ? " - " : it->first->name() ) << " " << it->second;
}
std::cout << std::endl;
};
protected:
TVector3 caloPosition_, rawCaloPosition_;
float energy_;
float corrEnergy_;
float corrEnergyErr_;
int iDet_, iPho_;
float r9_;
bool passId_;
bool sphericalPhoton_;
float rawEnergy_, rawCorrEnergy_, rawR9_, rawCorrEnergyErr_;
std::vector<int> smearingSeeds_;
std::vector<std::pair<const BaseSmearer *, float> > cache_;
};
#endif