26 double px = ptEtaPhiE[0] *
cos(ptEtaPhiE[2]);
27 double py = ptEtaPhiE[0] *
sin(ptEtaPhiE[2]);
28 double tmp = 2 * atan(
exp(-ptEtaPhiE[1]));
37 std::cout <<
"Please provide the name of the file (with file: or rfio: as needed) and if there is generator " 38 "information (0 is false)" 44 std::cout <<
"Please provide the name of the file with file: or rfio: as needed" << std::endl;
51 std::cout <<
"Dumping tree with genInfo = " << genInfo << std::endl;
54 gSystem->Load(
"libFWCoreFWLite");
67 std::vector<std::pair<unsigned int, unsigned long long> > evtRun;
68 treeHandler.
readTree(-1,
fileName, &pairVector, -20, &evtRun, &genPairVector);
70 if ((pairVector.size() != genPairVector.size()) && genInfo) {
71 std::cout <<
"Error: the size of pairVector and genPairVector is different" << std::endl;
77 MuonPairVector::const_iterator it = pairVector.begin();
78 MuonPairVector::const_iterator genIt = genPairVector.begin();
79 std::vector<std::pair<unsigned int, unsigned long long> >::iterator evtRunIt = evtRun.begin();
80 for (; it != pairVector.end(); ++it, ++genIt, ++evtRunIt) {
82 outputFile << it->first.pt() <<
" " << it->first.eta() <<
" " << it->first.phi() <<
" " << it->second.pt() <<
" " 83 << it->second.eta() <<
" " << it->second.phi() <<
" ";
85 outputFile << genIt->first.pt() <<
" " << genIt->first.eta() <<
" " << genIt->first.phi() <<
" " 86 << genIt->second.pt() <<
" " << genIt->second.eta() <<
" " << genIt->second.phi() <<
" ";
88 outputFile <<
" " << evtRunIt->first <<
" " << evtRunIt->second;
Sin< T >::type sin(const T &t)
void readTree(const int maxEvents, const TString &fileName, MuonPairVector *savedPair, const int muonType, std::vector< std::pair< unsigned int, unsigned long long > > *evtRun, MuonPairVector *genPair=nullptr)
static double constexpr muMass
Muon mass [GeV].
reco::Particle::LorentzVector lorentzVector
lorentzVector fromPtEtaPhiToPxPyPz(const double *ptEtaPhiE)
int main(int argc, char *argv[])
Cos< T >::type cos(const T &t)
static void enable()
enable automatic library loading
std::vector< std::pair< lorentzVector, lorentzVector > > MuonPairVector