74 histos1D_[
"mass" ] = fileService->
make< TH1D >(
"mass" ,
"Mass_{Z} (GeV)", 90, 30., 120.);
76 histos1D_[
"testPt" ] = fileService->
make< TH1D >(
"testPt" ,
"p_{T} (GeV)" , 100, 0., 100.);
78 histos1D_[
"probePt" ] = fileService->
make< TH1D >(
"probePt" ,
"p_{T} (GeV)" , 100, 0., 100.);
80 histos1D_[
"testEta" ] = fileService->
make< TH1D >(
"testEta" ,
"#eta" , 48, -2.4, 2.4);
82 histos1D_[
"probeEta"] = fileService->
make< TH1D >(
"probeEta",
"#eta" , 48, -2.4, 2.4);
104 for(
size_t idxTag=0; idxTag<muons->size(); ++idxTag){
106 if( trigRefTag.isAvailable() ){
108 for(
size_t idxProbe=0; idxProbe<muons->size() && idxProbe!=idxTag; ++idxProbe){
109 histos1D_[
"mass" ]->Fill( (muons->at(idxTag).p4()+muons->at(idxProbe).p4()).
mass() );
110 if(fabs((muons->at(idxTag).p4()+muons->at(idxProbe).p4()).
mass()-90)<5){
112 histos1D_[
"probePt" ]->Fill( muons->at(idxProbe).pt () );
113 histos1D_[
"probeEta" ]->Fill( muons->at(idxProbe).eta() );
114 if( trigRefProbe.isAvailable() ){
115 histos1D_[
"testPt" ]->Fill( muons->at(idxProbe).pt () );
116 histos1D_[
"testEta"]->Fill( muons->at(idxProbe).eta() );
135 for(
int bin=0;
bin<h.GetNbinsX(); ++
bin){
136 if(ref.GetBinContent(
bin+1)>0){
137 h.SetBinError(
bin+1,
sqrt((h.GetBinContent(
bin+1)*(1.-h.GetBinContent(
bin+1)))/ref.GetBinContent(
bin+1)));
138 }
else{ h.SetBinError(
bin+1, 0.); }
PatTriggerTagAndProbe(const edm::ParameterSet &iConfig)
default constructor
TriggerObjectRef triggerMatchObject(const reco::CandidateBaseRef &candRef, const TriggerObjectMatch *matchResult, const edm::Event &event, const TriggerEvent &triggerEvent) const
Methods.
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
everythin that needs to be done during the event loop
void endJob() override
everythin that needs to be done after the event loop
T * make(const Args &...args) const
make new ROOT object
edm::EDGetTokenT< pat::MuonCollection > muonsToken_
input for muons
edm::EDGetTokenT< pat::TriggerEvent > triggerEventToken_
input for patTriggerEvent
void setErrors(TH1D &h, const TH1D &ref)
helper function to set proper bin errors
std::vector< Muon > MuonCollection
collection of Muon objects
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
#define DEFINE_FWK_MODULE(type)
const TriggerPath * path(const std::string &namePath) const
bin
set the eta bin as selection string.
std::map< std::string, TH1D * > histos1D_
management of 1d histograms
void beginJob() override
everythin that needs to be done before the event loop
edm::Service< TFileService > fileService
~PatTriggerTagAndProbe() override
default destructor
std::string muonMatch_
input for trigger match objects
bool wasRun() const
Get the run flag.
bool wasAccept() const
Get the success flag.