28 #include "TObjArray.h"
29 #include "TClonesArray.h"
30 #include "TRefArray.h"
31 #include "TLorentzVector.h"
71 const double pi = 4.*atan(1.);
86 if(fabs(jet1.eta())>fabs(jet2.eta())){
93 tagJetP4->SetPxPyPzE(jet1.px(), jet1.py(), jet1.pz(), jet1.energy());
94 probeJetP4->SetPxPyPzE(jet2.px(), jet2.py(), jet2.pz(), jet2.energy());
109 for(vector<DetId>::const_iterator idItr = vid.begin(); idItr != vid.end(); idItr++)
113 double deta = fabs(jet2.eta() - pos.
eta());
114 double dphi = fabs(jet2.phi() - pos.
phi());
115 if(dphi>
pi){dphi=2*
pi-dphi;}
116 double dR_candidate =
sqrt(deta*deta + dphi*dphi);
120 if(dR_candidate <
dR && idepth == 1){
130 std::map<DetId,int> mapId;
131 vector<CaloTowerPtr> towers_fw = jet2.getCaloConstituents();
132 vector<CaloTowerPtr>::const_iterator towersItr;
133 for(towersItr = towers_fw.begin(); towersItr != towers_fw.end(); towersItr++){
134 size_t tower_size = (*towersItr)->constituentsSize();
135 for(
size_t i=0;
i<tower_size;
i++){
136 DetId id = (*towersItr)->constituent(
i);
148 ecItr != (*ec).end(); ++ecItr)
150 DetId id = ecItr->detid();
167 hbheItr!=hbhe->end(); hbheItr++)
169 DetId id = hbheItr->detid();
171 TCell* cell =
new TCell(
id.rawId(),hbheItr->energy());
172 (*cells)[nHits] = cell;
185 hoItr!=ho->end(); hoItr++)
187 DetId id = hoItr->detid();
189 TCell* cell =
new TCell(
id.rawId(),hoItr->energy());
190 (*cells)[nHits] = cell;
202 hfItr!=hf->end(); hfItr++)
204 DetId id = hfItr->detid();
206 TCell* cell =
new TCell(
id.rawId(),hfItr->energy());
207 (*cells)[nHits] = cell;
233 tree =
new TTree(
"hcalCalibTree",
"Tree for IsoTrack Calibration");
235 cells =
new TClonesArray(
"TCell");
240 tree->Branch(
"eventNumber", &
eventNumber,
"eventNumber/i");
241 tree->Branch(
"runNumber", &
runNumber,
"runNumber/i");
242 tree->Branch(
"iEtaHit", &
iEtaHit,
"iEtaHit/I");
243 tree->Branch(
"iPhiHit", &
iPhiHit,
"iPhiHit/i");
246 tree->Branch(
"xTrkHcal", &
xTrkHcal,
"xTrkHcal/F");
247 tree->Branch(
"yTrkHcal", &
yTrkHcal,
"yTrkHcal/F");
248 tree->Branch(
"zTrkHcal", &
zTrkHcal,
"zTrkHcal/F");
250 tree->Branch(
"PxTrkHcal", &
PxTrkHcal,
"PxTrkHcal/F");
251 tree->Branch(
"PyTrkHcal", &
PyTrkHcal,
"PyTrkHcal/F");
252 tree->Branch(
"PzTrkHcal", &
PzTrkHcal,
"PzTrkHcal/F");
254 tree->Branch(
"cells", &
cells, 64000);
255 tree->Branch(
"emEnergy", &
emEnergy,
"emEnergy/F");
256 tree->Branch(
"targetE", &
targetE,
"targetE/F");
257 tree->Branch(
"etVetoJet", &
etVetoJet,
"etVetoJet/F");
258 tree->Branch(
"tagJetP4",
"TLorentzVector", &
tagJetP4);
259 tree->Branch(
"probeJetP4",
"TLorentzVector", &
probeJetP4);
260 tree->Branch(
"tagJetEmFrac", &
tagJetEmFrac,
"tagJetEmFrac/F");
261 tree->Branch(
"probeJetEmFrac", &
probeJetEmFrac,
"probeJetEmFrac/F");
T getParameter(std::string const &) const
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
Jets made from CaloTowers.
TLorentzVector * tagJetP4
Sin< T >::type sin(const T &t)
std::string fOutputFileName
Geom::Phi< T > phi() const
std::vector< EcalRecHit >::const_iterator const_iterator
virtual void analyze(const edm::Event &, const edm::EventSetup &)
int depth() const
get the tower depth
DiJetAnalyzer(const edm::ParameterSet &)
int ieta() const
get the cell ieta
TLorentzVector * probeJetP4
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
int iphi() const
get the cell iphi
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.