35 gSystem->Load(
"libFWCoreFWLite" );
40 std::cout <<
"Usage : " << argv[0] <<
" [parameters.py]" << std::endl;
45 std::cout <<
" ERROR: ParametersSet 'process' is missing in your configuration file" << std::endl;
exit(0);
59 TH1F* muonPt_ = dir.
make<TH1F>(
"muonPt" ,
"pt" , 100, 0., 300.);
60 TH1F* muonEta_ = dir.make<TH1F>(
"muonEta" ,
"eta" , 100, -3., 3.);
61 TH1F* muonPhi_ = dir.make<TH1F>(
"muonPhi" ,
"phi" , 100, -5., 5.);
62 TH1F* mumuMass_= dir.make<TH1F>(
"mumuMass",
"mass", 90, 30., 120.);
66 int maxEvents_( inputHandler_.maxEvents() );
67 for(
unsigned int iFile=0; iFile<inputHandler_.files().size(); ++iFile){
69 TFile* inFile = TFile::Open(inputHandler_.files()[iFile].c_str());
83 if(maxEvents_>0 ? ievt+1>maxEvents_ :
false)
break;
85 if(inputHandler_.reportAfter()!=0 ? (ievt>0 && ievt%inputHandler_.reportAfter()==0) :
false)
86 std::cout <<
" processing event: " << ievt << std::endl;
90 event.getByLabel(muons_, muons);
93 for(std::vector<Muon>::const_iterator mu1=muons->begin(); mu1!=muons->end(); ++mu1){
94 muonPt_ ->Fill( mu1->pt () );
95 muonEta_->Fill( mu1->eta() );
96 muonPhi_->Fill( mu1->phi() );
97 if( mu1->pt()>20 && fabs(mu1->eta())<2.1 ){
98 for(std::vector<Muon>::const_iterator mu2=muons->begin(); mu2!=muons->end(); ++mu2){
100 if( mu1->charge()*mu2->charge()<0 ){
101 if( mu2->pt()>20 && fabs(mu2->eta())<2.1 ){
102 mumuMass_->Fill( (mu1->p4()+mu2->p4()).
mass() );
115 if(maxEvents_>0 ? ievt+1>maxEvents_ :
false)
break;
T getParameter(std::string const &) const
std::shared_ptr< ParameterSet > readPSetsFrom(std::string const &fileOrString)
Event const & toBegin()
Go to the very first Event.
static void enable()
enable automatic library loading
T * make(const Args &...args) const
make new ROOT object
virtual bool atEnd() const
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
std::string const & file() const
return output fuke name