194 cout<<
"the first tree has "<<firsttree_->GetEntries() <<
" entries"<<endl;
196 uint32_t nhits=0,noverlaps=0;
197 float posX(-99999.0),posY(-77777.0),posZ(-88888.0);
198 float posEta(-6666.0),posPhi(-5555.0),posR(-4444.0);
200 unsigned int layer=0;
202 firsttree_->SetBranchAddress(
"DetId", &
id);
203 firsttree_->SetBranchAddress(
"Nhits", &nhits);
204 firsttree_->SetBranchAddress(
"Noverlaps",&noverlaps);
205 firsttree_->SetBranchAddress(
"SubDet", &subdet);
206 firsttree_->SetBranchAddress(
"Layer", &layer);
209 firsttree_->SetBranchAddress(
"posX", &posX);
210 firsttree_->SetBranchAddress(
"posY", &posY);
211 firsttree_->SetBranchAddress(
"posZ", &posZ);
212 firsttree_->SetBranchAddress(
"posR", &posR);
213 firsttree_->SetBranchAddress(
"posEta", &posEta);
214 firsttree_->SetBranchAddress(
"posPhi", &posPhi);
222 unsigned int id_out=0;
223 uint32_t nhits_out=0,noverlaps_out=0;
224 float posX_out(-99999.0),posY_out(-77777.0),posZ_out(-88888.0);
225 float posEta_out(-6666.0),posPhi_out(-5555.0),posR_out(-4444.0);
227 unsigned int layer_out=0;
228 bool is2D_out=
false,isStereo_out=
false;
229 float prescfact_out=1.0;
230 float prescfact_overlap_out=1.0;
232 out_->Branch(
"DetId", &id_out ,
"DetId/i");
233 out_->Branch(
"Nhits", &nhits_out ,
"Nhits/i");
234 out_->Branch(
"Noverlaps",&noverlaps_out,
"Noverlaps/i");
235 out_->Branch(
"SubDet", &subdet_out,
"SubDet/I");
236 out_->Branch(
"Layer", &layer_out,
"Layer/i");
237 out_->Branch(
"is2D" , &is2D_out,
"is2D/B");
238 out_->Branch(
"isStereo", &isStereo_out,
"isStereo/B");
239 out_->Branch(
"posX", &posX_out,
"posX/F");
240 out_->Branch(
"posY", &posY_out,
"posY/F");
241 out_->Branch(
"posZ", &posZ_out,
"posZ/F");
242 out_->Branch(
"posR", &posR_out,
"posR/F");
243 out_->Branch(
"posEta", &posEta_out,
"posEta/F");
244 out_->Branch(
"posPhi", &posPhi_out,
"posPhi/F");
245 out_->Branch(
"PrescaleFactor",&prescfact_out,
"PrescaleFact/F");
246 out_->Branch(
"PrescaleFactorOverlap",&prescfact_overlap_out,
"PrescaleFactOverlap/F");
250 DetHitMap::iterator mapiter;
252 for(
int mod=0;
mod<firsttree_->GetEntries();
mod++){
257 firsttree_->GetEntry(
mod);
279 else subdetmax=-9999;
283 prescfact_out=float(
maxhits_)/float(nhits_out);
286 prescfact_overlap_out=float(
maxhits_)/float(noverlaps_out);
289 else if(subdetmax>0){
290 if(
int(nhits_out)>subdetmax){
291 prescfact_out=float(subdetmax/nhits_out);
293 if(
int(noverlaps_out)>subdetmax){
294 prescfact_overlap_out=float(subdetmax)/float(noverlaps_out);
299 prescfact_overlap_out=1.0;
307 cout<<
"Finished endJob after "<<
myclock.RealTime()<<
" s (real time) / "<<
myclock.CpuTime()<<
" s (cpu time)"<<endl;
308 cout<<
"Ending the tree merging."<<endl;
310 cout<<
"Deleting..."<<flush;
std::string firstfilename_
T mod(const T &a, const T &b)