StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
testMixer.C
1 void testMixer(char *file){
2 
3  gSystem->Load("MyEvent/MyEvent.so");
4  gSystem->Load("gamma/analysis/lib/AnaCuts.so");
5  gSystem->Load("gamma/analysis/lib/EventMixer.so");
6 
7  TFile *mFile=new TFile(file,"OPEN");
8  TTree *myEventTree;
9  myEventTree=(TTree*)mFile->Get("mEventTree");
10  MyEvent *ev=new MyEvent();
11  myEventTree->SetBranchAddress("branch",&ev);
12 
13  EventMixer *mix=new EventMixer("pp05");
14 
15  Int_t i=0;
16  while(myEventTree->GetEntry(i) && i<10000){
17 
18  MyEvent *e_add=new MyEvent(*ev);
19  mix->addEvent(e_add);
20 
21  i++;
22  }
23 
24  TCanvas *c=new TCanvas();
25  TH2F *h=new TH2F(*(TH2F*)mix->getMinvMB());
26  h->Draw("colz");
27  c->SaveAs("mix.eps");
28 
29 }