57 |
|
verbose_ = iConfig.getUntrackedParameter<bool>("verbose",false); |
58 |
|
|
59 |
|
useCentrality_ = iConfig.getUntrackedParameter<bool>("useCentrality",false); |
60 |
< |
useVtx_ = iConfig.getUntrackedParameter<bool>("useVtx",true); |
60 |
> |
useVtx_ = iConfig.getUntrackedParameter<bool>("useVtx",false); |
61 |
|
useJEC_ = iConfig.getUntrackedParameter<bool>("useJEC",true); |
62 |
|
usePat_ = iConfig.getUntrackedParameter<bool>("usePAT",true); |
63 |
|
|
104 |
|
t = fs1->make<TTree>("t",jetTagTitle.c_str()); |
105 |
|
|
106 |
|
// TTree* t= new TTree("t","Jet Response Analyzer"); |
107 |
< |
t->Branch("run",&jets_.run,"run/I"); |
107 |
> |
//t->Branch("run",&jets_.run,"run/I"); |
108 |
|
t->Branch("evt",&jets_.evt,"evt/I"); |
109 |
< |
t->Branch("lumi",&jets_.lumi,"lumi/I"); |
109 |
> |
//t->Branch("lumi",&jets_.lumi,"lumi/I"); |
110 |
|
t->Branch("b",&jets_.b,"b/F"); |
111 |
< |
t->Branch("vx",&jets_.vx,"vx/F"); |
112 |
< |
t->Branch("vy",&jets_.vy,"vy/F"); |
113 |
< |
t->Branch("vz",&jets_.vz,"vz/F"); |
114 |
< |
t->Branch("hf",&jets_.hf,"hf/F"); |
115 |
< |
t->Branch("nref",&jets_.nref,"nref/I"); |
116 |
< |
t->Branch("bin",&jets_.bin,"bin/I"); |
111 |
> |
if (useVtx_) { |
112 |
> |
t->Branch("vx",&jets_.vx,"vx/F"); |
113 |
> |
t->Branch("vy",&jets_.vy,"vy/F"); |
114 |
> |
t->Branch("vz",&jets_.vz,"vz/F"); |
115 |
> |
} |
116 |
> |
if (useCentrality_) { |
117 |
> |
t->Branch("hf",&jets_.hf,"hf/F"); |
118 |
> |
t->Branch("nref",&jets_.nref,"nref/I"); |
119 |
> |
t->Branch("bin",&jets_.bin,"bin/I"); |
120 |
> |
} |
121 |
|
t->Branch("rawpt",jets_.rawpt,"rawpt[nref]/F"); |
122 |
|
t->Branch("jtpt",jets_.jtpt,"jtpt[nref]/F"); |
123 |
|
t->Branch("jteta",jets_.jteta,"jteta[nref]/F"); |
182 |
|
|
183 |
|
LogDebug("HiInclusiveJetAnalyzer")<<"START event: "<<event<<" in run "<<run<<endl; |
184 |
|
|
181 |
– |
|
185 |
|
int bin = -1; |
186 |
|
double hf = 0.; |
187 |
|
double b = 999.; |
188 |
|
|
189 |
|
if(useCentrality_){ |
187 |
– |
//if(!isMC_){ |
190 |
|
if(!centrality_) centrality_ = new CentralityProvider(iSetup); |
191 |
|
centrality_->newEvent(iEvent,iSetup); // make sure you do this first in every event |
192 |
|
//double c = centrality_->centralityValue(); |
196 |
|
|
197 |
|
bin = centrality_->getBin(); |
198 |
|
b = centrality_->bMean(); |
197 |
– |
//} |
198 |
– |
/* |
199 |
– |
else{ |
200 |
– |
|
201 |
– |
TFile * centFile = new TFile("/net/hidsk0001/d00/scratch/mnguyen/CMSSW_3_9_1_patch1/src/macros/Hydjet_CentTable.root"); |
202 |
– |
|
203 |
– |
edm::Handle<reco::Centrality> cent; |
204 |
– |
iEvent.getByLabel(edm::InputTag("hiCentrality"),cent); |
205 |
– |
//cout<<" grabbed centrality "<<endl; |
206 |
– |
CentralityBins::RunMap cmap = getCentralityFromFile(centFile, "makeCentralityTableTFile", "HFhitsHydjet_2760GeV", 1, 1); |
207 |
– |
|
208 |
– |
// Still getting cent from hits. When tower tables become available, we need to switch |
209 |
– |
hf = cent->EtHFhitSum(); |
210 |
– |
//cout<<" hf "<<hf<<endl; |
211 |
– |
bin = cmap[run]->getBin(hf); |
212 |
– |
b = cmap[run]->bMeanOfBin(bin); |
213 |
– |
} |
214 |
– |
*/ |
199 |
|
} |
200 |
|
|
201 |
|
|