/data3/calcul/jacquem/working_dir/Micromegas/micromegasFrameWork/src/analyse/root/powerPulse.cpp File Reference

#include <map>
#include "TKey.h"
#include <TROOT.h>
#include <TStyle.h>
#include <TRint.h>
#include <TTree.h>
#include <TCanvas.h>
#include "TH1.h"
#include "TF1.h"
#include <TH1I.h>
#include <TH2I.h>
#include <TFile.h>
#include <stdlib.h>
#include <TSystem.h>
#include <iostream>
#include "TApplication.h"
#include <sstream>
#include "Log.hh"
#include <Rtypes.h>
#include "TColor.h"
#include "TFunction.h"
#include "TAttLine.h"
#include "TPaveStats.h"
#include "MicroException.hh"
#include <string>
#include "mTypes.h"
#include "root/MTRun.hh"
#include "root/MTChannel.hh"
#include "root/MTEvent.hh"

Include dependency graph for powerPulse.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)


Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 41 of file powerPulse.cpp.

00041                               {
00042         gROOT->Reset();
00043         
00044         gROOT->SetStyle("Plain");
00045         gStyle->SetTitleBorderSize(0);
00046         gStyle->SetTitleX(0.35);
00047         gStyle->SetTitleY(0.995);
00048 
00049         gStyle->SetFrameFillStyle(0);
00050         gStyle->SetOptStat("");
00051         gStyle->SetOptFit(0111);
00052         gStyle->SetStatX(0.9);
00053         gStyle->SetStatY(0.9);
00054         gStyle->SetStatH(0.1);
00055         gStyle->SetStatW(0.1);
00056 
00057         gStyle->SetOptStat("") ;
00058         gStyle->SetOptFit(0000);        
00059         
00060         gStyle->SetOptStat("");
00061         gStyle->SetOptFit(10001);
00062         
00063         
00064         
00065         
00066    if ( argc !=2  ) {
00067    FILE_LOG(logERROR)  << "usage: analog rootFile " << endl;
00068    exit(1);
00069   }
00070 
00071   string rootName;
00072   rootName.assign(argv[1]);
00073   int nbHit = 0;
00074   int nbEvt = 0;
00075 
00076   //TApplication *theApp  = NULL;
00077 
00078  // theApp  = new TRint("App",NULL,NULL );
00079 
00080 
00081   TFile *output= new TFile("output.root","RECREATE");
00082 
00083 
00084   UInt_t nb_ped=0 ;     // cut on number of pedestal event
00085 
00086   TFile f(rootName.c_str());
00087   TIter nextkey(f.GetListOfKeys());
00088   TKey *key;
00089   //TH1I * dacPed = new TH1I("ped","",391643019,820234834,1211877853);
00090   //TH1I * dacPed = new TH1I("ped","",100000,820234834,1211877853); //1109
00091   // TH1I * dacPed = new TH1I("ped","",100000,1682148314,2170757373); // 1112
00092   // TH1I * dacPed = new TH1I("ped","",100000,2437670539,2850616067); // 1114
00093   // TH1I * dacPed = new TH1I("ped","",100000,3098777110,3548395920); // 1116
00094    //TH1I * dacPed = new TH1I("ped","",100000,12721389,4293974986); // 1118
00095    TH1I * dacPed = new TH1I("ped","",100000,0,10000000000); // 1116
00096 
00097 
00098 
00099 
00100   UInt_t min = 0xffffffff;
00101   UInt_t max = 0;
00102 
00103   while (key = (TKey*)nextkey()) 
00104   {
00105     TTree *tree = (TTree*)key->ReadObj();                
00106 
00107     MTEvent *evt =  new MTEvent();
00108     TBranch *branch= tree->GetBranch("MTEvent");
00109     branch->SetAddress(&evt);
00110 
00111     MTChannel* channel =NULL;
00112     int nbEntries = tree->GetEntries();
00113 
00114     for ( int evtNum = 0; evtNum < nbEntries ; evtNum++)
00115     {
00116       tree->GetEntry(evtNum);
00117       nbEvt++;
00118 
00119       int nbChannel = evt->GetNchannel();
00120       for(int i=0;i<nbChannel  ;i++)
00121       {
00122         nbHit++;
00123         channel = (MTChannel*)evt->GetChannels()->UncheckedAt(i);
00124                     UInt_t absTime = (channel->GetBcIdAbs() ); 
00125         if ( absTime > max ) max = absTime;
00126         if ( absTime < min ) min = absTime;
00127         dacPed->Fill(absTime,1);
00128       }
00129     }
00130   }
00131   cout << "max " << max << endl;
00132   cout << "min " << min << endl;
00133  output->cd();
00134  dacPed->Write("");
00135 
00136         
00137 //   theApp->Run();
00138  //  delete theApp;
00139     return 0 ;
00140 }


Generated on Mon Jan 7 13:17:18 2013 for MicromegasFramework by  doxygen 1.4.7