24 #include "TObjArray.h"
25 #include "TClonesArray.h"
26 #include "TRefArray.h"
27 #include "TLorentzVector.h"
67 const double pi = 4.*atan(1.);
82 if(fabs(jet1.eta())>fabs(jet2.eta())){
89 tagJetP4->SetPxPyPzE(jet1.px(), jet1.py(), jet1.pz(), jet1.energy());
90 probeJetP4->SetPxPyPzE(jet2.px(), jet2.py(), jet2.pz(), jet2.energy());
105 for(vector<DetId>::const_iterator idItr = vid.begin(); idItr != vid.end(); idItr++)
109 double deta = fabs(jet2.eta() - pos.
eta());
110 double dphi = fabs(jet2.phi() - pos.
phi());
111 if(dphi>
pi){dphi=2*
pi-dphi;}
112 double dR_candidate =
sqrt(deta*deta + dphi*dphi);
116 if(dR_candidate <
dR && idepth == 1){
126 std::map<DetId,int> mapId;
127 vector<CaloTowerPtr> towers_fw = jet2.getCaloConstituents();
128 vector<CaloTowerPtr>::const_iterator towersItr;
129 for(towersItr = towers_fw.begin(); towersItr != towers_fw.end(); towersItr++){
130 size_t tower_size = (*towersItr)->constituentsSize();
131 for(
size_t i=0;
i<tower_size;
i++){
132 DetId id = (*towersItr)->constituent(
i);
144 ecItr != (*ec).end(); ++ecItr)
146 DetId id = ecItr->detid();
163 hbheItr!=hbhe->end(); hbheItr++)
165 DetId id = hbheItr->detid();
167 TCell* cell =
new TCell(
id.rawId(),hbheItr->energy());
168 (*cells)[nHits] = cell;
181 hoItr!=ho->end(); hoItr++)
183 DetId id = hoItr->detid();
185 TCell* cell =
new TCell(
id.rawId(),hoItr->energy());
186 (*cells)[nHits] = cell;
198 hfItr!=hf->end(); hfItr++)
200 DetId id = hfItr->detid();
202 TCell* cell =
new TCell(
id.rawId(),hfItr->energy());
203 (*cells)[nHits] = cell;
229 tree =
new TTree(
"hcalCalibTree",
"Tree for IsoTrack Calibration");
231 cells =
new TClonesArray(
"TCell");
236 tree->Branch(
"eventNumber", &
eventNumber,
"eventNumber/i");
237 tree->Branch(
"runNumber", &
runNumber,
"runNumber/i");
238 tree->Branch(
"iEtaHit", &
iEtaHit,
"iEtaHit/I");
239 tree->Branch(
"iPhiHit", &
iPhiHit,
"iPhiHit/i");
242 tree->Branch(
"xTrkHcal", &
xTrkHcal,
"xTrkHcal/F");
243 tree->Branch(
"yTrkHcal", &
yTrkHcal,
"yTrkHcal/F");
244 tree->Branch(
"zTrkHcal", &
zTrkHcal,
"zTrkHcal/F");
246 tree->Branch(
"PxTrkHcal", &
PxTrkHcal,
"PxTrkHcal/F");
247 tree->Branch(
"PyTrkHcal", &
PyTrkHcal,
"PyTrkHcal/F");
248 tree->Branch(
"PzTrkHcal", &
PzTrkHcal,
"PzTrkHcal/F");
250 tree->Branch(
"cells", &
cells, 64000);
251 tree->Branch(
"emEnergy", &
emEnergy,
"emEnergy/F");
252 tree->Branch(
"targetE", &
targetE,
"targetE/F");
253 tree->Branch(
"etVetoJet", &
etVetoJet,
"etVetoJet/F");
254 tree->Branch(
"tagJetP4",
"TLorentzVector", &
tagJetP4);
255 tree->Branch(
"probeJetP4",
"TLorentzVector", &
probeJetP4);
256 tree->Branch(
"tagJetEmFrac", &
tagJetEmFrac,
"tagJetEmFrac/F");
257 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.
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
TLorentzVector * tagJetP4
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Sin< T >::type sin(const T &t)
std::string fOutputFileName
edm::EDGetTokenT< reco::CaloJetCollection > tok_jets_
Geom::Phi< T > phi() const
std::vector< EcalRecHit >::const_iterator const_iterator
virtual void analyze(const edm::Event &, const edm::EventSetup &)
edm::EDGetTokenT< EcalRecHitCollection > tok_ec_
int depth() const
get the tower depth
DiJetAnalyzer(const edm::ParameterSet &)
int ieta() const
get the cell ieta
TLorentzVector * probeJetP4
edm::EDGetTokenT< HORecHitCollection > tok_ho_
int iphi() const
get the cell iphi
std::vector< DetId > getValidDetIds() const
Get the list of all valid detector ids.
edm::EDGetTokenT< HFRecHitCollection > tok_hf_