]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/ITSSDDBASda.cxx
A prototype macro for the TDR7 layout
[u/mrichter/AliRoot.git] / ITS / ITSSDDBASda.cxx
index 0875fd5fda402bb4a92cb6a140aa17052db20411..2ff40bf05dbebb676ad52ef0d8d2b83724216cdf 100644 (file)
@@ -1,6 +1,6 @@
 /*
 - Contact: - prino@to.infn.it
-- Link: - http://www.to.infn.it/~prino/alice/RawData/run11161.date
+- Link: - alien:///alice/data/2009/LHC09c_SDD/000079094/raw/09000079094024.10.root
 - Run Type: - PEDESTAL_RUN
 - DA Type: - LDC
 - Number of events needed: > 10
@@ -64,7 +64,7 @@ extern "C" {
       Arguments: list of DATE raw data files
 */
 int main(int argc, char **argv) {
-
+  // main - Arguments: list of DATE raw data files
   int status = 0;
 
   // line added to solve IO problems
@@ -115,12 +115,17 @@ int main(int argc, char **argv) {
   
   /* report progress */
   daqDA_progressReport(8);
+
   Int_t iev;
   Int_t ievPed;
+  Int_t ievUsed;
+  Int_t nEvToBeSkipped=5;
+
   for(Int_t iStep=0;iStep<2;iStep++){
     printf("Start Analysis Step %d\n",iStep);
     iev=0;
     ievPed=0;
+    ievUsed=0;
     if(iStep==1){
       for(Int_t iddl=0; iddl<kTotDDL;iddl++){
        for(Int_t imod=0; imod<kModPerDDL;imod++){
@@ -187,8 +192,14 @@ int main(int argc, char **argv) {
        case CALIBRATION_EVENT:
          break;  // uncomment this line for test raw data
        case PHYSICS_EVENT: // uncomment this line for test raw data
-         printf(" event number = %i \n",iev);
-         ievPed++; 
+         printf(" Event number = %i ",iev);
+         ievPed++;
+         if(ievPed<=nEvToBeSkipped){
+           printf(" -> SKIP\n");
+           break;
+         }
+         printf("  -> Analyze\n");
+         ievUsed++;
          AliRawReader *rawReader = new AliRawReaderDate((void*)event);
          rawReader->Reset();
          UChar_t cdhAttr=AliITSRawStreamSDD::ReadBlockAttributes(rawReader);
@@ -243,7 +254,7 @@ int main(int argc, char **argv) {
          /* free resources */
          free(event);
        }
-       if(ievPed>=maxNEvents) break;
+       if(ievUsed>=maxNEvents) break;
       }
     }
 
@@ -263,7 +274,7 @@ int main(int argc, char **argv) {
   /* write report */
   TDatime time;
   TObjString timeinfo(Form("%02d%02d%02d%02d%02d%02d",time.GetYear()-2000,time.GetMonth(),time.GetDay(),time.GetHour(),time.GetMinute(),time.GetSecond()));
-  printf("Run #%s, received %d calibration events, time %s\n",getenv("DATE_RUN_NUMBER"),ievPed,timeinfo.GetString().Data());
+  printf("Run #%s, received %d calibration events, time %s\n",getenv("DATE_RUN_NUMBER"),ievUsed,timeinfo.GetString().Data());
 
   /* report progress */
   daqDA_progressReport(90);
@@ -298,14 +309,14 @@ int main(int argc, char **argv) {
 
 #ifdef ALI_AMORE
   amore::da::AmoreDA amoreDA(amore::da::AmoreDA::kSender);
-  Int_t status =0;
-  status += amoreDA.Send("TimeInfo",&timeinfo);
-  status += amoreDA.Send("Baselines",basHistos);
-  status += amoreDA.Send("RawNoise",noiseHistos);
-  status += amoreDA.Send("CommonMode",cmnHistos);
-  status += amoreDA.Send("CorrectedNoise",corrnHistos);
-  status += amoreDA.Send("NoisyChannels",statusHistos);
-  if ( status )
+  Int_t statusamore =0;
+  statusamore += amoreDA.Send("TimeInfoPedestal",&timeinfo);
+  statusamore += amoreDA.Send("Baselines",basHistos);
+  statusamore += amoreDA.Send("RawNoise",noiseHistos);
+  statusamore += amoreDA.Send("CommonMode",cmnHistos);
+  statusamore += amoreDA.Send("CorrectedNoise",corrnHistos);
+  statusamore += amoreDA.Send("NoisyChannels",statusHistos);
+  if ( statusamore )
     printf("Warning: Failed to write Arrays in the AMORE database\n");
   else 
     printf("amoreDA.Send() OK\n");