/data3/calcul/jacquem/working_dir/Micromegas/micromegasFrameWork/src/analyse/TB2010/Testbeam_june_10/Hardroc2/Beam_profile/Beam_profile_hardroc2.C

Go to the documentation of this file.
00001 {
00002   gROOT->Reset();
00003    gStyle->SetPalette(1);
00004   gSystem->Load("/home/micromegas/Framework/libMicro.so");
00005 
00006 
00007 
00008 
00009 
00010 
00011   TString filename = "/lapp_data/LC/Detecteurs/MicroMegas/data/TB2010/SPS_H4_june_2010/Root_files/acq_HR2_14062010_1844_SLAB2_1.root"; 
00012 
00013 
00014   Long64_t t,t1,t2,t3,dt;
00015   int nchannel = 0;
00016   int hardid = 0;
00017   int softid = 0;
00018   int chipid = 0;
00019   int nhit = 0;
00020   int xpos = 0;  
00021   int ypos = 0;  
00022   int zpos = 0;  
00023   int adc = 0;  
00024 
00025   TH1I * hdt = new TH1I("hdt","",100,-10,90);
00026   TH2I * hxy_m2 = new TH2I("hxy_m2","",96,0,96,96,0,96);
00027   TH2I * hxy_m2_cut = new TH2I("hxy_m2_cut","",96,0,96,96,0,96);
00028   
00029   
00030 
00031 
00032   TFile *f = new TFile(filename);
00033   cout<<"reading File : "<<filename<<endl;
00034 
00035   TIter nextkey(f.GetListOfKeys());
00036   TKey *key;
00037 
00038   while (key = (TKey*)nextkey()) {
00039     
00040     TTree *tree = (TTree*)key->ReadObj();                
00041     MTRun* run = (MTRun*)tree->GetUserInfo()->FindObject("MTRun");
00042     //run->Info();
00043 
00044   int nEvent = tree.GetEntries();
00045   cout <<"nEvent="<<nEvent<<endl;
00046 
00047   MTEvent *evt = new MTEvent();
00048 
00049   TBranch *branch= tree->GetBranch("MTEvent");
00050   branch->SetAddress(&evt);
00051 
00052 
00053 
00054 
00055 
00056 
00057 
00058   for (int i=0;i<nEvent;i++){  
00059   //for (int i=113;i<114;i++){  
00060 
00061     tree.GetEntry(i);
00062     nchannel = evt->GetNchannel();
00063 
00064     //cout<<"event number = "<<i<<"  Number of hits = "<<nchannel<<endl;
00065 
00066     MTChannel* channel = (MTChannel*)evt->GetChannels()->UncheckedAt(0);
00067     
00068     for (int j=0;j<nchannel;j++){
00069       
00070       MTChannel* channel = (MTChannel*)evt->GetChannels()->UncheckedAt(j);
00071       
00072       xpos = channel->GetX();
00073       ypos = channel->GetY();
00074 
00075       hardid = channel->GetHardId();
00076       chipid = channel->GetChipId();
00077       
00078       hxy_m2->Fill(xpos,ypos);
00079       
00080       t1 = channel->GetBcId_Abs();
00081       t2 = channel->GetBcId_Dif();
00082       t3 = channel->GetBcId_Hit();
00083       dt = (t2-t3);
00084       t = (t1 - (t2-t3));
00085       
00086       hdt->Fill(dt);
00087       
00088       if (dt>=4 && dt<=10){hxy_m2_cut->Fill(xpos,ypos);}}}}
00089 
00090 
00091 hdt->Draw();
00092 
00093 
00094 }

Generated on Mon Jan 7 13:15:22 2013 for MicromegasFramework by  doxygen 1.4.7