Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:10:36

0001 {
0002 #include "ToBeLoaded.C"
0003   string filename;
0004   cout<<"filename: "<<endl;
0005   cin >> filename;
0006 
0007   TFile f(filename.c_str());
0008   string the_event; 
0009   int Xtal_num; 
0010 
0011   int width; 
0012   int height;
0013   int event = 1; 
0014   cout<<"first event: "; cin>>event;
0015   cout<<"Xtal: "; cin>>Xtal_num;
0016   cout<<"width: ";cin>>width;
0017   cout<<"height: ";cin>>height;
0018 
0019   int mX= width;
0020   int nY= height;
0021   if(!(mX>0 && mX%2 == 1 )||!(nY>0 && nY%2 == 1 )){cout<<" width and height has to be greater than 0 and odd."<<endl;return 3;}
0022   int* windCry = new int[mX*nY];
0023   H4Geom SMGeom; SMGeom.init();
0024   
0025   if(Xtal_num<1 || Xtal_num > 1700){cout<<" xtal ragne 1->1700"<<endl;}
0026   
0027   SMGeom.getWindow(windCry, Xtal_num, mX, nY);
0028 
0029   int pippo = 0;
0030   
0031   the_event = IntToString(event);
0032 
0033   TCanvas can("Digi","digi",200,50,900,900);
0034   can.Divide(width,height);
0035     
0036   for(int kk=0 ; kk<width*height ; kk++){
0037     string xtal = IntToString(windCry[kk]);
0038     string name = "Graph_ev"+the_event+"_ic"+xtal;
0039     cout<<name<<endl;
0040     TGraph* gra = (TGraph*) f.Get(name.c_str());
0041     int canvas_num = width*height - (kk%height)*width - width + 1 + kk/height;
0042     can.cd(canvas_num);
0043     if( gra != NULL ){
0044       gra->GetXaxis()->SetTitle("sample");
0045       gra->GetYaxis()->SetTitle("adc");
0046       gra ->Draw("A*");
0047       can.Update();
0048     }
0049   }
0050   can.cd((width*height+1)/2);
0051   can.Update();
0052   TCanvas canB("next","next",10,50,180,200);
0053   TButton *but = new TButton (" next ",".x $CMSSW_BASE/src/EventFilter/EcalTBRawToDigi/data/macro/DrawGraphs.C",0,0,1,1);
0054   but->Draw();
0055 }
0056 //return 0;
0057   
0058 }