Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46360
b: "refs/heads/CMSSW_7_1_X"
c: 1546e6c
h: "refs/heads/CMSSW_7_1_X"
v: v3
  • Loading branch information
uberthon committed Jun 23, 2008
1 parent 32b275f commit 6ff0ab4
Show file tree
Hide file tree
Showing 9 changed files with 183 additions and 273 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
refs/heads/gh-pages: ac155dadd83efa75cad55c0508a57a2b9dd3d66c
"refs/heads/CMSSW_7_1_X": 6bbb4ebf636486b42d9b155252257aa59c051f4e
"refs/heads/CMSSW_7_1_X": 1546e6c673333f2fa3a11acc0438b3a80963ca2a
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//
// Original Author: Ursula Berthon, Stephanie Baffioni, Pascal Paganini
// Created: Thu Jul 4 11:38:38 CEST 2005
// $Id: EcalTrigPrimAnalyzer.cc,v 1.14 2008/06/19 14:22:38 uberthon Exp $
// $Id: EcalTrigPrimAnalyzer.cc,v 1.15 2008/06/20 13:15:23 uberthon Exp $
//
//

Expand All @@ -21,6 +21,7 @@
#include <utility>

// user include files
//#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
Expand All @@ -38,9 +39,9 @@
#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
#include "Geometry/Records/interface/CaloGeometryRecord.h"
#include "Geometry/Records/interface/IdealGeometryRecord.h"

#include "CondFormats/EcalObjects/interface/EcalTPGScale.h"
#include "CalibCalorimetry/EcalTPGTools/interface/EcalTPGScale.h"

#include "EcalTrigPrimAnalyzer.h"

Expand Down Expand Up @@ -72,14 +73,15 @@ EcalTrigPrimAnalyzer::EcalTrigPrimAnalyzer(const edm::ParameterSet& iConfig)
sprintf(title,"%s_fgvb",ecal_parts_[i].c_str());
ecal_fgvb_[i]=new TH1I(title,"FGVB",10,0,10);
}

label_= iConfig.getParameter<std::string>("Label");
producer_= iConfig.getParameter<std::string>("Producer");
recHits_= iConfig.getParameter<bool>("AnalyzeRecHits");
label_=iConfig.getParameter<edm::InputTag>("inputTP");
if (recHits_) {
hTPvsRechit_= new TH2F("TP_vs_RecHit","TP vs rechit",256,-1,255,255,0,255);
hTPoverRechit_= new TH1F("TP_over_RecHit","TP over rechit",500,0,4);
rechits_labelEB_=iConfig.getParameter<edm::InputTag>("inputRecHitsEB");
rechits_labelEE_=iConfig.getParameter<edm::InputTag>("inputRecHitsEE");
rechits_labelEB_= iConfig.getParameter<std::string>("RecHitsLabelEB");
rechits_labelEE_= iConfig.getParameter<std::string>("RecHitsLabelEE");
rechits_producer_= iConfig.getParameter<std::string>("RecHitsProducer");
}
}

Expand Down Expand Up @@ -109,9 +111,10 @@ EcalTrigPrimAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup &

// Get input
edm::Handle<EcalTrigPrimDigiCollection> tp;
iEvent.getByLabel(label_,tp);
iEvent.getByLabel(label_,producer_,tp);
for (unsigned int i=0;i<tp.product()->size();i++) {
EcalTriggerPrimitiveDigi d=(*(tp.product()))[i];
// for (int ii=0;ii<d.size();++ii) printf(" TP %d, sample %d, et %d\n",i,ii,d[ii].compressedEt());fflush(stdout);
int subdet=d.id().subDet()-1;
if (subdet==0) {
ecal_et_[subdet]->Fill(d.compressedEt());
Expand All @@ -130,18 +133,18 @@ EcalTrigPrimAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup &

// comparison with RecHits
edm::Handle<EcalRecHitCollection> rechit_EB_col;
iEvent.getByLabel(rechits_labelEB_,rechit_EB_col);
iEvent.getByLabel(rechits_producer_,rechits_labelEB_,rechit_EB_col);

edm::Handle<EcalRecHitCollection> rechit_EE_col;
iEvent.getByLabel(rechits_labelEE_,rechit_EE_col);
iEvent.getByLabel(rechits_producer_,rechits_labelEE_, rechit_EE_col);


edm::ESHandle<CaloGeometry> theGeometry;
edm::ESHandle<CaloSubdetectorGeometry> theBarrelGeometry_handle;
edm::ESHandle<CaloSubdetectorGeometry> theEndcapGeometry_handle;
iSetup.get<CaloGeometryRecord>().get( theGeometry );
iSetup.get<EcalEndcapGeometryRecord>().get("EcalEndcap",theEndcapGeometry_handle);
iSetup.get<EcalBarrelGeometryRecord>().get("EcalBarrel",theBarrelGeometry_handle);
iSetup.get<IdealGeometryRecord>().get( theGeometry );
iSetup.get<IdealGeometryRecord>().get("EcalEndcap",theEndcapGeometry_handle);
iSetup.get<IdealGeometryRecord>().get("EcalBarrel",theBarrelGeometry_handle);

const CaloSubdetectorGeometry *theEndcapGeometry,*theBarrelGeometry;
theEndcapGeometry = &(*theEndcapGeometry_handle);
Expand Down Expand Up @@ -208,27 +211,27 @@ EcalTrigPrimAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup &


EcalTPGScale ecalScale ;
ecalScale.setEventSetup(iSetup) ;
for (unsigned int i=0;i<tp.product()->size();i++) {
EcalTriggerPrimitiveDigi d=(*(tp.product()))[i];
const EcalTrigTowerDetId TPtowid= d.id();
map<EcalTrigTowerDetId, float>::iterator it= mapTow_Et.find(TPtowid);
float Et = ecalScale.getTPGInGeV(d.compressedEt(), TPtowid) ;
if (d.id().ietaAbs()==27 || d.id().ietaAbs()==28) Et*=2;
iphi_ = TPtowid.iphi() ;
ieta_ = TPtowid.ieta() ;
tpgADC_ = d.compressedEt() ;
tpgGeV_ = Et ;
ttf_ = d.ttFlag() ;
fg_ = d.fineGrain() ;
if (it!= mapTow_Et.end()) {
float Et = ecalScale.getTPGInGeV(iSetup, d) ;
if (d.id().ietaAbs()==27 || d.id().ietaAbs()==28) Et*=2;
hTPvsRechit_->Fill(it->second,Et);
hTPoverRechit_->Fill(Et/it->second);
iphi_ = TPtowid.iphi() ;
ieta_ = TPtowid.ieta() ;
eRec_ = it->second ;
tpgADC_ = d.compressedEt() ;
tpgGeV_ = Et ;
ttf_ = d.ttFlag() ;
fg_ = d.fineGrain() ;
tree_->Fill() ;
}
tree_->Fill() ;
}


}

void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@
//
// Original Author: Ursula Berthon
// Created: Thu Jul 4 11:38:38 CEST 2005
// $Id: EcalTrigPrimAnalyzer.h,v 1.6 2008/04/01 15:52:42 uberthon Exp $
// $Id: EcalTrigPrimAnalyzer.h,v 1.7 2008/06/20 13:15:23 uberthon Exp $
//
//


// system include files
//#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/ParameterSet/interface/InputTag.h"
#include "FWCore/Framework/interface/EDAnalyzer.h"

#include "FWCore/Framework/interface/Event.h"
Expand Down Expand Up @@ -60,10 +59,11 @@ class EcalTrigPrimAnalyzer : public edm::EDAnalyzer {
int iphi_, ieta_ , tpgADC_, ttf_, fg_ ;
float eRec_, tpgGeV_ ;

edm::InputTag label_;

edm::InputTag rechits_labelEB_;
edm::InputTag rechits_labelEE_;
std::string label_;
std::string producer_;
std::string rechits_labelEB_;
std::string rechits_labelEE_;
std::string rechits_producer_;

bool recHits_;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
#include "Geometry/Records/interface/IdealGeometryRecord.h"

#include "CondFormats/EcalObjects/interface/EcalTPGScale.h"
#include "CalibCalorimetry/EcalTPGTools/interface/EcalTPGScale.h"

#include "EcalTrigPrimAnalyzerMIPs.h"

Expand Down
Loading

0 comments on commit 6ff0ab4

Please sign in to comment.