00001
00002
00003
00004
00005
00006 struct HIT
00007 {
00008 Float_t x,y,z;
00009 Float_t rad,phi;
00010 Float_t raderror,phierror;
00011 };
00012
00013 struct CLUSTER
00014 {
00015 Float_t timepos,padpos,timesigma,padsigma;
00016 Float_t peakheight, charge;
00017 Int_t timebin,pad;
00018 Int_t padlength,timelength;
00019 Int_t row,sec;
00020 Int_t flag;
00021 Int_t numpeaks;
00022 };
00023
00024 struct EVENT
00025 {
00026 Float_t run;
00027 Int_t nevent;
00028 Float_t temperature,pressure;
00029 };
00030
00031
00032
00033 void listPadOcc(const Char_t *fileName="filelist.txt")
00034 {
00035
00036 CLUSTER cluster;
00037 HIT hit;
00038 EVENT event;
00039
00040
00041 gROOT->Reset();
00042 gStyle->SetTitleOffset(1.25);
00043 gStyle->SetCanvasBorderMode(0);
00044 gStyle->SetPadBorderMode(0);
00045 gStyle->SetPadColor(0);
00046 gStyle->SetCanvasColor(0);
00047 gStyle->SetTitleColor(0);
00048 gStyle->SetStatColor(0);
00049 gStyle->SetPalette(1);
00050 gStyle->SetOptStat(1111);
00051 gStyle->SetOptFit();
00052
00053 Int_t maxentries;
00054 Int_t nevents=0;
00055
00056 Int_t PadEntries[2][60][160];
00057
00058
00059 for (int isec=0;isec<60;isec++){
00060 for (int irow=0;irow<2;irow++){
00061 for (int ipad=0;ipad<160;ipad++){
00062 PadEntries[irow][isec][ipad]=0;
00063 }
00064 }
00065 }
00066
00067
00068
00069
00070 char **fList = new char[200][256];
00071 int nfile=0;
00072 ifstream fin(fileName);
00073 if (fin) {
00074 int j=0;
00075 cout << "Input file " << fileName << " found." << endl;
00076 for (Int_t i=0;i<200;i++){
00077 char *line = new char[256];
00078 fin >> line;
00079 if (fin.eof()) break;
00080 fList[j] = line;
00081 cout << " Added file : " << fList[j] << endl;
00082 j++;
00083 }
00084 nfile = j;
00085 }
00086 fin.close();
00087
00088
00089
00090 for (Int_t ifile=0;ifile<nfile;ifile++) {
00091 TString eingabe = fList[ifile];
00092 TFile f(eingabe);
00093
00094
00095
00096
00097 TTree *dtree=(TTree*) f.Get("cl");
00098 TBranch *bcluster=dtree->GetBranch("cluster");
00099 bcluster->SetAddress(&cluster);
00100 TBranch *bevent=dtree->GetBranch("event");
00101 bevent->SetAddress(&event);
00102
00103 bevent->GetEntry(0);
00104
00105 Int_t CurrentEvent = event.nevent;
00106 nevents++;
00107 maxentries=bcluster->GetEntries();
00108
00109
00110 for (int i=0;i<=maxentries;i++) {
00111 bevent->GetEntry(i);
00112 if (event.nevent != CurrentEvent){
00113
00114 CurrentEvent = event.nevent;
00115 nevents++;
00116 }
00117 bcluster->GetEntry(i);
00118
00119 if ((cluster.padlength>=3&&cluster.padlength<=6) &&
00120 (cluster.timelength>=4&&cluster.timelength<=8)){
00121
00122 PadEntries[cluster.row-1][cluster.sec-1][cluster.pad-1]++;
00123 }
00124 }
00125 }
00126
00127 cout<<nevents<<" Events analyzed"<<endl;
00128
00129 cout<<endl;
00130 cout<<" Pad occupancy for all clusters in all sectors which passed the cuts (3<=padlength<=6 and 4<=timelength<=8) for a 'good' cluster:"<<endl;
00131 cout<<endl;
00132
00133 Int_t npad;
00134
00135
00136 for (int irow=0;irow<2;irow++){
00137 cout<<"Padrow "<<irow+1<<endl;
00138 npad=0;
00139 for (int isec=0;isec<6;isec++){
00140 for (int ipad=0;ipad<160;ipad++){
00141
00142 cout<<irow+1<<" "<<isec+1<<" "<<npad<<" ("<<ipad+1<<") "<<PadEntries[irow][isec][ipad]<<endl;
00143 npad++;
00144 }
00145 }
00146 }
00147
00148
00149 for (int irow=0;irow<2;irow++){
00150 cout<<"Padrow "<<irow+3<<endl;
00151 npad=0;
00152 for (int isec=6;isec<12;isec++){
00153 for (int ipad=0;ipad<160;ipad++){
00154
00155 cout<<irow+1<<" "<<isec+1<<" "<<npad<<" ("<<ipad+1<<") "<<PadEntries[irow][isec][ipad]<<endl;
00156 npad++;
00157 }
00158 }
00159 }
00160
00161
00162 for (int irow=0;irow<2;irow++){
00163 cout<<"Padrow "<<irow+5<<endl;
00164 npad=0;
00165 for (int isec=12;isec<18;isec++){
00166 for (int ipad=0;ipad<160;ipad++){
00167
00168 cout<<irow+1<<" "<<isec+1<<" "<<npad<<" ("<<ipad+1<<") "<<PadEntries[irow][isec][ipad]<<endl;
00169 npad++;
00170 }
00171 }
00172 }
00173
00174
00175 for (int irow=0;irow<2;irow++){
00176 cout<<"Padrow "<<irow+7<<endl;
00177 npad=0;
00178 for (int isec=18;isec<24;isec++){
00179 for (int ipad=0;ipad<160;ipad++){
00180
00181 cout<<irow+1<<" "<<isec+1<<" "<<npad<<" ("<<ipad+1<<") "<<PadEntries[irow][isec][ipad]<<endl;
00182 npad++;
00183 }
00184 }
00185 }
00186
00187
00188 for (int irow=0;irow<2;irow++){
00189 cout<<"Padrow "<<irow+9<<endl;
00190 npad=0;
00191 for (int isec=24;isec<30;isec++){
00192 for (int ipad=0;ipad<160;ipad++){
00193
00194 cout<<irow+1<<" "<<isec+1<<" "<<npad<<" ("<<ipad+1<<") "<<PadEntries[irow][isec][ipad]<<endl;
00195 npad++;
00196 }
00197 }
00198 }
00199
00200 }
00201