00001 void getPrescales(const char *input)
00002 {
00003 gSystem->Load("MyEvent/MyEvent");
00004
00005 TFile *mFile=new TFile(input,"OPEN");
00006 TTree *myEventTree=(TTree*)mFile->Get("mEventTree");
00007 MyEvent *ev=new MyEvent();
00008 myEventTree->SetBranchAddress("branch",&ev);
00009
00010 int i=0;
00011 int runprev=0;
00012 int NmbInRun=0;
00013 int Nht1InRun=0;
00014 int Nht2InRun=0;
00015 float ps_mb=0.;
00016 float ps_ht1=0.;
00017 float ps_ht2=0;
00018 while(myEventTree->GetEntry(i)){
00019 int runn=ev->runId();
00020 if(runn!=runprev){
00021 if(i==0) cout<<"run nmb nht1 nht2 psmb psht1 psht2"<<endl;
00022 else cout<<runprev<<" "<<NmbInRun<<" "<<Nht1InRun<<" "<<Nht2InRun<<" "<<ps_mb<<" "<<ps_ht1<<" "<<ps_ht2<<endl;
00023
00024 runprev=runn;
00025 ps_mb=ev->prescale(0);
00026 ps_ht1=ev->prescale(2);
00027 ps_ht2=ev->prescale(3);
00028 NmbInRun=0;
00029 Nht1InRun=0;
00030 Nht2InRun=0;
00031
00032 }
00033
00034 if(ev->trigger()&1) NmbInRun++;
00035 if(ev->trigger()&2) Nht1InRun++;
00036 if(ev->trigger()&4) Nht2InRun++;
00037
00038 i++;
00039 }
00040
00041 }