#define MyMc_cxx // The class definition in MyMc.h has been generated automatically // by the ROOT utility TTree::MakeSelector(). This class is derived // from the ROOT class TSelector. For more information on the TSelector // framework see $ROOTSYS/README/README.SELECTOR or the ROOT User Manual. // The following methods are defined in this file: // Begin(): called everytime a loop on the tree starts, // a convenient place to create your histograms. // SlaveBegin(): called after Begin(), when on PROOF called only on the // slave servers. // Process(): called for each event, in this function you decide what // to read and fill your histograms. // SlaveTerminate: called at the end of the loop on the tree, when on PROOF // called only on the slave servers. // Terminate(): called at the end of the loop on the tree, // a convenient place to draw/fit your histograms. // // To use this file, try the following session on your Tree T: // // Root > T->Process("MyMc.C") // Root > T->Process("MyMc.C","some options") // Root > T->Process("MyMc.C+") // #include "MyMc.h" #include #include #include "TLorentzVector.h" TH1F *dmassg1= new TH1F("massg"," M #rho ",40,0.5,1.1); TH1F *drapg= new TH1F("rapg"," rapidity #rho ",28,-10.,10.); TH1F *drapg2= new TH1F("rapg2"," rapidity #rho ",8,-4.,4.); TH1F *dphi= new TH1F("phi"," #rho phi ",30,-0.2,0.2); TH1F *deta= new TH1F("eta"," #rho eta ",30,-0.2,0.2); TH1F *dpt= new TH1F("pt"," #rho P_{t} ",30,-0.2,0.2); TH1F *dptpt= new TH1F("ptpt"," #rho #Delta P_{t}/P_{t} ",30,-1.2,1.2); void MyMc::Begin(TTree *tree) { // The Begin() function is called at the start of the query. // When running with PROOF Begin() is only called on the client. // The tree argument is deprecated (on PROOF 0 is passed). TString option = GetOption(); } void MyMc::SlaveBegin(TTree *tree) { // The SlaveBegin() function is called after the Begin() function. // When running with PROOF SlaveBegin() is called on each slave server. // The tree argument is deprecated (on PROOF 0 is passed). Init(tree); TString option = GetOption(); } Bool_t MyMc::Process(Long64_t entry) { // The Process() function is called for each entry in the tree (or possibly // keyed object in the case of PROOF) to be processed. The entry argument // specifies which entry in the currently loaded tree is to be processed. // It can be passed to either TTree::GetEntry() or TBranch::GetEntry() // to read either all or the required parts of the data. When processing // keyed objects with PROOF, the object is already loaded and is available // via the fObject pointer. // // This function should contain the "body" of the analysis. It can contain // simple or elaborate selection criteria, run algorithms on the data // of the event and typically fill histograms. // WARNING when a selector is used with a TChain, you must use // the pointer to the current TTree to call GetEntry(entry). // The entry is always the local entry number in the current tree. // Assuming that fChain is the pointer to the TChain being processed, // use fChain->GetTree()->GetEntry(entry). fChain->GetTree()->GetEntry(entry); // generated distributions float px=0, py=0, pz=0, pt=0, etot= 0, sumpid=0; float px1=0, py1=0, pz1=0, pt1; float px2=0, py2=0, pz2=0, pt2, ptrho; float ptTrack1=0, ptTrack2=0, ptpi=0; for( int i =0; i < nPart; i++) { if(pPart_pid[i] == 9 || pPart_pid[i] == 8) if( i < 2) { pt= pPart_pt[i]; etot+= pPart_e[i]; sumpid+=pPart_pid[i]; if(sumpid==8 || sumpid==9) { pt1= pPart_pt[i]; } if(pPart_pid[i]==8) { ptpi= pPart_pt[i]; } if(sumpid==17) { pt2= pPart_pt[i]; } } } if(sumpid==17) { ptrho=pt1+pt2; } if(nPrim ==2 && nTot<=5) for(int i=0;i100.) continue; if(pPairs_rV0[i]>15.) continue; if(pPairs_tr1_nHits[i]<14 || pPairs_tr2_nHits[i]<14 ) continue; if(fabs(pPairs_pionH_yRap[i])>1.) continue; if(pPairs_pionH_mInv[i]<1.1 && pPairs_pionH_mInv[i]>0.4) { if(pPairs_pCharge[i]==0) { if(pPairs_pPt[i]<0.15) { ptTrack1 = pPairs_tr1_pt[i]; ptTrack2 = pPairs_tr2_pt[i]; dptpt->Fill((ptTrack1 - pt1)/pt1); dptpt->Fill((ptTrack1 - pt2)/pt2); dptpt->Fill((ptTrack2 - pt1)/pt1); dptpt->Fill((ptTrack2 - pt2)/pt2); //dptpt->Fill((pg1R.Pt()-pg1.Pt())/pg1.Pt()); //dptpt->Fill((pg1R.Pt()-pg2.Pt())/pg2.Pt()); //dptpt->Fill((pg2R.Pt()-pg1.Pt())/pg1.Pt()); //dptpt->Fill((pg2R.Pt()-pg2.Pt())/pg2.Pt()); } } } } return kTRUE; } void MyMc::SlaveTerminate() { // The SlaveTerminate() function is called after all entries or objects // have been processed. When running with PROOF SlaveTerminate() is called // on each slave server. } void MyMc::Terminate() { // The Terminate() function is the last function to be called during // a query. It always runs on the client, it can be used to present // the results graphically or save the results to file. }