void DetMax(){ // Selection of sensorID, FE and channel (update with full stat!) // aggiungi controllo per files non utilizzabili e correggi distrib temp Int_t sID = 170; Int_t fFE = 0; Int_t fch = 60; gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C"); Int_t nFiles = 1000; TString HitsFileMulti[nFiles]; /* TString HitsFile0 = "../digi_sttcombi_1000.root"; TString HitsFile1 = "../digi_sttcombi_1001.root"; TString HitsFile2 = "../digi_sttcombi_1002.root"; TString HitsFile3 = "../digi_sttcombi_1003.root"; TString HitsFile4 = "../digi_sttcombi_1004.root"; TString HitsFile5 = "../digi_sttcombi_1005.root"; TString HitsFile6 = "../digi_sttcombi_1006.root"; TString HitsFile7 = "../digi_sttcombi_1007.root"; TString HitsFile8 = "../digi_sttcombi_1008.root"; TString HitsFile9 = "../digi_sttcombi_1009.root";*/ for (Int_t kk = 0 ; kk < nFiles ; kk++) { HitsFileMulti[kk] = Form("../digi_sttcombi_%d.root",2000+kk); cout << HitsFileMulti[kk] << endl; } TH1F *sens = new TH1F("sens","sens",600,-0.5,599.5); TH1F *fe = new TH1F("fe","fe",12,-0.5,11.5); TH1F *ch = new TH1F("ch","ch",128,-0.5,127.5); // TH3F *h3 = new TH3F("h3","h3",600,-0.5,599.5,12,-0.5,11.5,128,-0.5,127.5); TH2F *h2 = new TH2F("h2","h2",600,-0.5,599.5,12,-0.5,11.5); TCanvas *can = new TCanvas(); can->Divide(3,1); // Loading the geometry and defining the geo handler TChain *t = new TChain("cbmsim"); t->Add(HitsFileMulti[0]); t->Add(HitsFileMulti[1]); t->Add(HitsFileMulti[2]); t->Add(HitsFileMulti[3]); t->Add(HitsFileMulti[4]); t->Add(HitsFileMulti[5]); t->Add(HitsFileMulti[6]); t->Add(HitsFileMulti[7]); t->Add(HitsFileMulti[8]); t->Add(HitsFileMulti[9]); for (Int_t kk = 0 ; kk < nFiles ; kk++) { t->Add(HitsFileMulti[kk]); } TClonesArray *arr = new TClonesArray("PndSdsDigiStrip",10); t->SetBranchAddress("MVDStripDigis",&arr);//Branch names cout << "Events: " << t->GetEntries() << endl; Int_t sss,fff,ccc; Int_t maxS,maxF,maxC; for (Int_t j = 0 ; j < t->GetEntries() ; j++) // loop on events { if (j%10000==0) cout << "Event " << j << endl; t->GetEvent(j); for (Int_t k = 0 ; k < arr->GetEntries() ; k++) { PndSdsDigiStrip *dig = (PndSdsDigiStrip*) arr->At(k); sss = dig->GetSensorID(); fff = dig->GetFE(); h2->Fill(sss,fff); sens->Fill(dig->GetSensorID()); if (sss==sID) { fe->Fill(fff); } } } // end loop on events can->cd(1); sens->Draw(); can->cd(2); fe->Draw(); can->cd(3); h2->Draw("COLZ"); cout << "Absolute max: " << h2->GetMaximum() << endl; Int_t bX,bY; h2->GetMaximumBin(bX,bY); cout << "Max: sens = " << h2->GetXaxis()->GetBinCenter(bX) << ", fe = " << h2->GetYaxis()->GetBinCenter(bY) << endl; }