/* include files */ #include #include #include #include #include #include #include using namespace std; // root include files #include "TApplication.h" // needed to display canvas #include "TSystem.h" #include "TCanvas.h" #include "TFile.h" #include "TH1.h" #include "TH1F.h" #include "TH2F.h" #include "TH3F.h" #include "TF1.h" #include "TMath.h" #include "TGraph.h" #include "TGraphErrors.h" #include "FDCchannels.h" int main(int argc, char **argv) { int Slot = 0; int DISPLAY = 1; char CrateName[128] = "One"; char filename[128] = "samples.pdf"; int version = 1; int doprint=0; int TheRoc=0; char InputFiles[10][128]; int ROCNum[10] = {2,3,5,6,7,8,9,10,11,12}; int ADCSlotNum[15] = {3,4,5,6,7,8,9,10,13,14,15,16,17,18,19}; int SCANNER=1; char detector[128] = "FDC"; if (argc>1){ for (int i=1;iSetFillColor(42); gPad->SetGrid(); } double array[5000]; double xaxis[5000]; int loli = 0; int hili = 10; if (TheRoc){ loli = TheRoc-2; if (TheRoc>3){ loli = TheRoc-3; } hili = loli+1; } for (int n=loli;n>EVENT>>SLOT>>chan; //if ((EVENT != EventNew) || (NSlot != SLOT)){ if (1){ mult[n][SLOT]->Fill(chan); EventNew = EVENT; NSlot = SLOT; int con = (chan)/24; int FDC = Package[n][SLOT][con]; int P = Plane[n][SLOT][con]; int C = Connector[n][SLOT][con]; int L = Layer[n][SLOT][con]; float channel = (C-1)*24. + (23-(chan - con*24)) + 1; // Reverse order!=> 23-c Strips[FDC-1][P-1][L]->Fill(channel); } if ((DISPLAY) && (SLOT>-1)){ int Max = 0; while (iss>>array[Max]){ xaxis[Max] = Max; Max++; } //cout<0){ TGraph *gr = new TGraph(Max,xaxis,array); gr->SetTitle(tit); gr->SetMarkerColor(4); gr->SetMarkerStyle(21); gr->GetXaxis()->SetTitle("sample number"); gr->GetYaxis()->SetTitle("ADC counts"); gr->Draw("ALP"); myc1->Update(); gPad->SetGrid(); gPad->Modified(); if (doprint){ myc1->SaveAs(filename); } if (SCANNER){ cout<<"continue?"<>answ; } } } } INF.close(); } } TFile *fout; sprintf(fnam,"%s/adcs_hitmultiplicities_%d_ALLROCS.root",DataDir,version); if (TheRoc){ sprintf(fnam,"%s/adcs_hitmultiplicities_%d_ROC%d.root",DataDir,version,TheRoc); } fout = new TFile(fnam,"RECREATE"); for (int m=0;m<10;m++){ for (int k=0;kWrite(); } } for (int m=0;m<4;m++) { for (int i=0;i<6;i++) { for (int j=0;j<2;j++) { Strips[m][i][j]->Write(); } } } fout->Close(); return 0; }