25 double muMass = 0.105658;
26 double px = ptEtaPhiE[0]*
cos(ptEtaPhiE[2]);
27 double py = ptEtaPhiE[0]*
sin(ptEtaPhiE[2]);
28 double tmp = 2*atan(
exp(-ptEtaPhiE[1]));
29 double pz = ptEtaPhiE[0]*
cos(tmp)/
sin(tmp);
30 double E =
sqrt(px*px+py*py+pz*pz+muMass*muMass);
39 std::cout <<
"Please provide the name of the file and if there is generator information (0 is false)" << std::endl;
47 std::cout <<
"Reading tree dump with genInfo = " << genInfo << std::endl;
50 gSystem->Load(
"libFWCoreFWLite" );
54 std::vector<MuonPair> pairVector;
55 std::vector<GenMuonPair> genPairVector;
61 inputFile.open(fileName.c_str());
67 while( !inputFile.eof() ) {
68 getline(inputFile, line);
71 std::stringstream
ss(line);
72 for(
int i=0;
i<6; ++
i ) {
78 for(
int i=0;
i<6; ++
i ) {
88 if( (pairVector.size() != genPairVector.size()) && genInfo ) {
89 std::cout <<
"Error: the size of pairVector and genPairVector is different" << std::endl;
93 treeHandler.
writeTree(
"TreeFromDump.root", &pairVector, 0, &genPairVector);
94 std::cout <<
"Filling tree with genInfo" << std::endl;
97 treeHandler.
writeTree(
"TreeFromDump.root", &pairVector);
Sin< T >::type sin(const T &t)
reco::Particle::LorentzVector lorentzVector
int main(int argc, char **argv)
lorentzVector fromPtEtaPhiToPxPyPz(const double *ptEtaPhiE)
Cos< T >::type cos(const T &t)
void writeTree(const TString &fileName, const std::vector< MuonPair > *savedPair, const int muonType=0, const std::vector< GenMuonPair > *genPair=0, const bool saveAll=false)
std::vector< std::vector< double > > tmp
static void enable()
enable automatic library loading