Updated DA
authorcoppedis <coppedis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 Nov 2011 17:02:36 +0000 (17:02 +0000)
committercoppedis <coppedis@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 29 Nov 2011 17:02:36 +0000 (17:02 +0000)
ZDC/ZDCMAPPINGda.cxx

index fa2bc33..293e248 100644 (file)
@@ -76,7 +76,7 @@ int main(int argc, char **argv) {
   int const kNModules = 10;\r
   int const kNChannels = 24;\r
   int const kNScChannels = 32;  \r
-  int const kZDCTDCGeo=4;\r
+  int const kZDCTDCGeo = 4;\r
   \r
   int itdc=0, iprevtdc=-1, ihittdc=0;\r
   float tdcData[6], tdcL0=-999.;       \r
@@ -109,7 +109,7 @@ int main(int argc, char **argv) {
     tdcMod[y]=tdcCh[y]=tdcSigCode[y]=tdcDet[y]=tdcSec[y]=-1;\r
   }\r
  \r
-  TH1F * hTDC[6];\r
+  TH1F * hTDC[6]={0x0,0x0,0x0,0x0,0x0,0x0};\r
   char ntdchist[20];\r
   for(Int_t it=0; it<6; it++){\r
     if(it==0)      hTDC[it] = new TH1F("TDCZNC", "TDC ZNC", 200, -200., 200.);\r
@@ -277,22 +277,43 @@ int main(int argc, char **argv) {
        }\r
        \r
        while(rawStreamZDC->Next()){\r
-          if(eventT==PHYSICS_EVENT && rawStreamZDC->GetADCModule()==kZDCTDCGeo && rawStreamZDC->IsZDCTDCDatum()==kTRUE){\r
+         if(rawStreamZDC->GetADCModule()!=kZDCTDCGeo) continue; //skipping ADCs, scalers and trigger cards\r
+\r
+          if(rawStreamZDC->GetADCModule()==kZDCTDCGeo && rawStreamZDC->IsZDCTDCDatum()==kTRUE){\r
              //\r
             itdc = rawStreamZDC->GetChannel(); \r
-            if((itdc>=8 && itdc<=13) || itdc==15){\r
-               if(itdc==iprevtdc) ihittdc++;\r
-               else ihittdc=0;\r
-               iprevtdc=itdc;\r
-               if(ihittdc<1 && itdc!=15) tdcData[itdc-8] = 0.025*rawStreamZDC->GetZDCTDCDatum();\r
-              if(itdc==15 && ihittdc<1) tdcL0 = 0.025*rawStreamZDC->GetZDCTDCDatum();\r
+             if(itdc==iprevtdc) ihittdc++;\r
+             else ihittdc=0;\r
+             iprevtdc=itdc;\r
+            //\r
+            //if(ihittdc==0) printf("   TDC%d %1.0f ns  \n",itdc, 0.025*rawStreamZDC->GetZDCTDCDatum());\r
+            //\r
+            if(((itdc>=8 && itdc<=13) || itdc==15) && ihittdc<1){\r
+               if(itdc!=15){\r
+                tdcData[itdc-8] = 0.025*rawStreamZDC->GetZDCTDCDatum();\r
+                //\r
+                //printf("   **** TDC%d %1.0f ns  \n",itdc, tdcData[itdc-8]);\r
+              }\r
+              //\r
+              else if(itdc==15){\r
+                 tdcL0 = 0.025*rawStreamZDC->GetZDCTDCDatum();\r
+                 //\r
+                 //printf("   ++++ TDCL0 %1.0f ns  \n",tdcL0);\r
+                 //\r
+                 for(int ic=0; ic<6; ic++){\r
+                   if(tdcData[ic]!=-999. && tdcL0!=-999.){\r
+                     hTDC[ic]->Fill(tdcData[ic]-tdcL0);\r
+                     //printf(" -> Filling histo%d: %f ns\n",ic, tdcData[ic]-tdcL0);\r
+                   }\r
+                 }\r
+               }\r
             }\r
          }\r
         }\r
        \r
-       for(int ic=0; ic<6; ic++){\r
-         if(tdcData[ic]!=-999. && tdcL0!=-999.) hTDC[ic]->Fill(tdcData[ic]-tdcL0);\r
-       }\r
+        /*for(int ic=0; ic<6; ic++){\r
+          if(tdcData[ic]!=-999. && tdcL0!=-999.) hTDC[ic]->Fill(tdcData[ic]-tdcL0);\r
+        }*/\r
        nphys++;\r
        \r
       }//(if PHYSICS_EVENT) \r
@@ -321,8 +342,8 @@ int main(int argc, char **argv) {
   //\r
   Float_t xUp=0., xLow=0., deltaX=0;\r
   Int_t binMax=0, nBinsx=0;\r
-  Float_t mean[6], sigma[6];\r
-  TF1 *fitfun[6];\r
+  Float_t mean[6]={0.,0.,0.,0.,0.,0.}, sigma[6]={0.,0.,0.,0.,0.,0.};\r
+  TF1 *fitfun[6]={0x0,0x0,0x0,0x0,0x0,0x0};\r
   for(Int_t k=0; k<6; k++){\r
     if(hTDC[k]->GetEntries()!=0){\r
        binMax = hTDC[k]->GetMaximumBin();\r