Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:36

0001 #ifndef MuScleFitTreeProvenance_cc
0002 #define MuScleFitTreeProvenance_cc
0003 
0004 #include <iostream>
0005 
0006 #include <TH1F.h>
0007 #include <TROOT.h>
0008 #include <TFile.h>
0009 #include <TSystem.h>
0010 
0011 #include "FWCore/FWLite/interface/FWLiteEnabler.h"
0012 #include "PhysicsTools/FWLite/interface/TFileService.h"
0013 #include "MuonAnalysis/MomentumScaleCalibration/interface/MuScleFitProvenance.h"
0014 
0015 int main(int argc, char* argv[]) {
0016   if (argc != 2) {
0017     std::cout << "Please provide the name of the file with file: or rfio: as needed" << std::endl;
0018     return 1;
0019   }
0020   std::string fileName(argv[1]);
0021   if (fileName.find("file:") != 0 && fileName.find("rfio:") != 0) {
0022     std::cout << "Please provide the name of the file with file: or rfio: as needed" << std::endl;
0023     return 1;
0024   }
0025 
0026   std::cout << "Reading provenance information from the tree:" << std::endl;
0027 
0028   // open input file (can be located on castor)
0029   TFile* inFile = TFile::Open(fileName.c_str());
0030 
0031   MuScleFitProvenance* provenance = (MuScleFitProvenance*)(inFile->Get("MuScleFitProvenance"));
0032   std::cout << "MuonType = " << provenance->muonType << std::endl;
0033 
0034   return 0;
0035 }
0036 
0037 #endif