]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding the macro and the task to run the LRC code in the EBYE module (Andrey Ivanov)
authorpchrist <pchrist@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 27 May 2009 14:46:53 +0000 (14:46 +0000)
committerpchrist <pchrist@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 27 May 2009 14:46:53 +0000 (14:46 +0000)
ITS/AliITSQASSDDataMakerRec.cxx
ITS/AliITSsimulationSSD.cxx
ITS/AliITSsimulationSSD.h
PWG2/EBYE/LRC/AliAnalysisTaskLRC.cxx [new file with mode: 0644]
PWG2/EBYE/LRC/AliAnalysisTaskLRC.h [new file with mode: 0644]
PWG2/EBYE/macros/runLRCAnalysis.C [new file with mode: 0644]
PWG2/SPECTRA/AliProtonAnalysisBase.cxx
PWG2/SPECTRA/AliProtonAnalysisBase.h
PWG2/SPECTRA/macros/configProtonAnalysis.C
PWG2/SPECTRA/macros/runProtonAnalysis.C
PWG2/SPECTRA/macros/runProtonAnalysisQA.C

index 9d2a136bf8101f4955f8e425872db2d45b323bf4..bd200f80af8286ee23854aa2d5775d4762e02d92 100644 (file)
@@ -42,7 +42,7 @@
 #include "AliITSgeomTGeo.h"
 #include "AliRawEventHeaderBase.h"
 #include "AliITSRecPoint.h"
-#include "AliITSdigit.h"
+#include "AliITSdigitSSD.h"
 #include "AliITSBadChannelsSSDv2.h"
 
 #include "AliCDBManager.h"
@@ -186,24 +186,25 @@ void AliITSQASSDDataMakerRec::StartOfDetectorCycle()
 void AliITSQASSDDataMakerRec::EndOfDetectorCycle(AliQAv1::TASKINDEX_t /*task*/, TObjArray* /*list*/)
 {
   // launch the QA checking
-  if (  fAliITSQADataMakerRec->GetRawsData(0) == NULL ) // Raws not defined
-    return ; 
   // launch the QA checking
   AliDebug(AliQAv1::GetQADebugLevel(),"AliITSDM instantiates checker with Run(AliQAv1::kITS, task, list)\n"); 
   AliDebug(AliQAv1::GetQADebugLevel(), Form("Offset: %d\n",fGenRawsOffset));
-  //Data size per DDL
-  for(Int_t i = 0; i < fgkNumOfDDLs; i++) {
-    Double_t gSizePerDDL = TMath::Power(10,(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+5+i))->GetMean())/1e+06;
-    //cout<<"DDL: "<<i+2<<" - Size: "<<gSizePerDDL<<" - Mean: "<<
-    //(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+5+i))->GetMean()<<endl;
-    ((TH1D *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+4)))->SetBinContent(i+2,gSizePerDDL);
-  }
-  
-  //Data size per LDC
-  for(Int_t i = 0; i < fgkNumOfLDCs; i++) {
-    Double_t gSizePerLDC = TMath::Power(10,(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+23+i))->GetMean())/1e+06;
-    ((TH1D *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+22)))->SetBinContent(i+6,gSizePerLDC);
-  }
+
+  if (fAliITSQADataMakerRec->GetRawsData(0) != NULL ) {
+    //Data size per DDL
+    for(Int_t i = 0; i < fgkNumOfDDLs; i++) {
+      Double_t gSizePerDDL = ((TH1D *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+5+i))->GetMean();
+      //cout<<"DDL: "<<i+2<<" - Size: "<<gSizePerDDL<<" - Mean: "<<
+      //(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+5+i))->GetMean()<<endl;
+      ((TH1D *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+4)))->SetBinContent(i+2,gSizePerDDL);
+    }
+    
+    //Data size per LDC
+    for(Int_t i = 0; i < fgkNumOfLDCs; i++) {
+      Double_t gSizePerLDC = ((TH1F *)fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+23+i))->GetMean();
+      ((TH1D *)(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+22)))->SetBinContent(i+6,gSizePerLDC);
+    }
+  }//raw data end of cycle
 
   //online part
   if(fkOnline) {
@@ -306,65 +307,65 @@ void AliITSQASSDDataMakerRec::InitRaws() {
   AliDebug(AliQAv1::GetQADebugLevel(), Form("Number of histograms (SPD+SDD): %d\n",fGenRawsOffset));
   TString gTitle = 0;
   //book online-offline QA histos
-  TH1D *fHistSSDEventType = new TH1D("SSD/DataSize/fHistSSDEventType",
+  TH1D *fHistSSDEventType = new TH1D("fHistSSDEventType",
                                     ";Event type;Events",
                                     31,-1,30);
   fAliITSQADataMakerRec->Add2RawsList(fHistSSDEventType, 
                                      fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
   fSSDRawsOffset += 1;
-  TH1D *fHistSSDDataSize = new TH1D("SSD/DataSize/fHistSSDDataSize",
-                                   ";log(SSD data size) [Bytes];Events",
-                                   100,3,8);
+  TH1D *fHistSSDDataSize = new TH1D("fHistSSDDataSize",
+                                   ";(SSD data size) [KB];Events",
+                                   1000,0,500);
   fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSize, 
                                      fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
   fSSDRawsOffset += 1;
-  TH1D *fHistSSDDataSizePercentage = new TH1D("SSD/DataSize/fHistSSDDataSizePercentage",
+  TH1D *fHistSSDDataSizePercentage = new TH1D("fHistSSDDataSizePercentage",
                                              ";SSD data size [%];Events",
-                                             100,0,100);
+                                             1000,0,100);
   fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizePercentage, 
                                      fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
   fSSDRawsOffset += 1;
-  TH1D *fHistSSDDDLId = new TH1D("SSD/DDL/fHistSSDDDLId",
+  TH1D *fHistSSDDDLId = new TH1D("fHistSSDDDLId",
                                 ";DDL id;Events",20,510.5,530.5);
   fAliITSQADataMakerRec->Add2RawsList(fHistSSDDDLId, 
                                      fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
   fSSDRawsOffset += 1;
-  TH1D *fHistSSDDataSizePerDDL = new TH1D("SSD/DataSize/fHistSSDDataSizePerDDL",
-                                         ";DDL id;<SSD data size> [MB]",
+  TH1D *fHistSSDDataSizePerDDL = new TH1D("fHistSSDDataSizePerDDL",
+                                         ";DDL id;<SSD data size> [KB]",
                                          20,510.5,530.5);
   fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizePerDDL, 
                                      fGenRawsOffset+fSSDRawsOffset, !expert, image, !saveCorr);
   fSSDRawsOffset += 1;
   TH1D *fHistSSDDataSizeDDL[fgkNumOfDDLs];
   for(Int_t i = 1; i < fgkNumOfDDLs+1; i++) {
-    gTitle = "SSD/DDL/fHistSSDDataSizeDDL"; gTitle += i+511;
+    gTitle = "fHistSSDDataSizeDDL"; gTitle += i+511;
     fHistSSDDataSizeDDL[i-1] = new TH1D(gTitle.Data(),
-                                       ";log(SSD data size) [Bytes];Events",
-                                       100,1,8);
+                                       ";(SSD data size) [KB];Events",
+                                       1000,0,50);
     fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizeDDL[i-1], 
                                        fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
     fSSDRawsOffset += 1;
   }
   
-  TH1D *fHistSSDLDCId = new TH1D("SSD/LDC/fHistSSDLDCId",";LDC id;Events",10,0.5,10.5);
+  TH1D *fHistSSDLDCId = new TH1D("fHistSSDLDCId",";LDC id;Events",10,0.5,10.5);
   fAliITSQADataMakerRec->Add2RawsList(fHistSSDLDCId, 
                                      fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
   fSSDRawsOffset += 1;
-  TH1D *fHistSSDDataSizePerLDC = new TH1D("SSD/DataSize/fHistSSDDataSizePerLDC",
-                                         ";LDC id;<SSD data size> [MB]",
+  TH1D *fHistSSDDataSizePerLDC = new TH1D("fHistSSDDataSizePerLDC",
+                                         ";LDC id;<SSD data size> [KB]",
                                          20,0.5,20.5);
   fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizePerLDC, 
                                      fGenRawsOffset+fSSDRawsOffset, !expert, image, !saveCorr);
   fSSDRawsOffset += 1;
   TH1D *fHistSSDDataSizeLDC[fgkNumOfLDCs];
   for(Int_t i = 1; i < fgkNumOfLDCs+1; i++) {
-    gTitle = "SSD/LDC/fHistSSDDataSizeLDC"; 
+    gTitle = "fHistSSDDataSizeLDC"; 
     if(i == 1) gTitle += "082";
     if(i == 2) gTitle += "086";
     if(i == 3) gTitle += "085";
     fHistSSDDataSizeLDC[i-1] = new TH1D(gTitle.Data(),
-                                       ";log(SSD data size) [Bytes];Events",
-                                       100,1,8);
+                                       ";SSD data size [KB];Events",
+                                       1000,0,100);
     fAliITSQADataMakerRec->Add2RawsList(fHistSSDDataSizeLDC[i-1], 
                                        fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
     fSSDRawsOffset += 1;
@@ -377,18 +378,13 @@ void AliITSQASSDDataMakerRec::InitRaws() {
     TH1D *fHistSSDOccupancyModule[fgkSSDMODULES]; 
     for(Int_t i = 500; i < fgkSSDMODULES + 500; i++) {
       AliITSgeomTGeo::GetModuleId(i,gLayer,gLadder,gModule);
-      gTitle = "SSD/Occupancy/Layer"; gTitle += gLayer;
-      gTitle += "/Ladder"; 
+      gTitle = "fHistSSD_Occupancy_Layer";
       if(gLayer == 5) {
-       gTitle +=  499+gLadder;
-       gTitle += "/fHistSSD_Occupancy_Layer"; gTitle += gLayer;
-       gTitle += "_Ladder"; 
+       gTitle += gLayer; gTitle += "_Ladder"; 
        gTitle += 499+gLadder;
       }
       if(gLayer == 6) {
-       gTitle += 599+gLadder;
-       gTitle += "/fHistSSD_Occupancy_Layer"; gTitle += gLayer;
-       gTitle += "_Ladder"; 
+       gTitle += gLayer; gTitle += "_Ladder"; 
        gTitle += 599+gLadder;
       }
       gTitle += "_Module"; gTitle += gModule; 
@@ -408,18 +404,13 @@ void AliITSQASSDDataMakerRec::InitRaws() {
     for(Int_t iLayer = 5; iLayer < 7; iLayer++) {
       for(Int_t iLadder = 1; iLadder < AliITSgeomTGeo::GetNLadders(iLayer) + 1; iLadder++) {
        //P-side occupancy plots
-       gTitle = "SSD/Occupancy/Layer"; gTitle += iLayer;
-       gTitle += "/Ladder";
+       gTitle = "fHistSSD_Occupancy_Layer"; 
        if(iLayer == 5) {
-         gTitle += 499+iLadder;
-         gTitle += "/fHistSSD_Occupancy_Layer"; gTitle += iLayer;
-         gTitle += "_Ladder"; 
+         gTitle += iLayer; gTitle += "_Ladder"; 
          gTitle += 499+iLadder;
        }
        if(iLayer == 6) {
-         gTitle += 599+iLadder;
-         gTitle += "/fHistSSD_Occupancy_Layer"; gTitle += iLayer;
-         gTitle += "_Ladder"; 
+         gTitle += iLayer; gTitle += "_Ladder"; 
          gTitle += 599+iLadder;
        }
        gTitle += "_PSide";
@@ -434,18 +425,13 @@ void AliITSQASSDDataMakerRec::InitRaws() {
                                            fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
        occupancyCounter += 1; fSSDRawsOffset += 1;
        //N-side occupancy plots
-       gTitle = "SSD/Occupancy/Layer"; gTitle += iLayer;
-       gTitle += "/Ladder";
+       gTitle = "fHistSSD_Occupancy_Layer"; 
        if(iLayer == 5) {
-         gTitle += 499+iLadder;
-         gTitle += "/fHistSSD_Occupancy_Layer"; gTitle += iLayer;
-         gTitle += "_Ladder"; 
+         gTitle += iLayer; gTitle += "_Ladder"; 
          gTitle += 499+iLadder;
        }
        if(iLayer == 6) {
-         gTitle += 599+iLadder;
-         gTitle += "/fHistSSD_Occupancy_Layer"; gTitle += iLayer;
-         gTitle += "_Ladder"; 
+         gTitle += iLayer; gTitle += "_Ladder"; 
          gTitle += 599+iLadder;
        }
        gTitle += "_NSide";
@@ -464,7 +450,7 @@ void AliITSQASSDDataMakerRec::InitRaws() {
 
     //top level occupancy plots
     //occupancy per module - no threshold
-    TH2D *fHistSSDOccupancyLayer5 = new TH2D("SSD/Occupancy/Layer5/fHistSSDOccupancyLayer5",
+    TH2D *fHistSSDOccupancyLayer5 = new TH2D("fHistSSDOccupancyLayer5",
                                             ";N_{modules};N_{Ladders}",
                                             fgkSSDMODULESPERLADDERLAYER5,
                                             0,fgkSSDMODULESPERLADDERLAYER5,
@@ -480,7 +466,7 @@ void AliITSQASSDDataMakerRec::InitRaws() {
     fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyLayer5, 
                                        fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
     fSSDRawsOffset += 1;
-    TH2D *fHistSSDOccupancyLayer6 = new TH2D("SSD/Occupancy/Layer6/fHistSSDOccupancyLayer6",
+    TH2D *fHistSSDOccupancyLayer6 = new TH2D("fHistSSDOccupancyLayer6",
                                             ";N_{modules};N_{Ladders}",
                                             fgkSSDMODULESPERLADDERLAYER6,
                                             0,fgkSSDMODULESPERLADDERLAYER6,
@@ -497,12 +483,12 @@ void AliITSQASSDDataMakerRec::InitRaws() {
     fSSDRawsOffset += 1;
 
     //occupancy per module - threshold @ 3%
-    TH2D *fHistSSDOccupancyThresholdLayer5 = new TH2D("SSD/Occupancy/Layer5/fHistSSDOccupancyThresholdLayer5",
-                                            ";N_{modules};N_{Ladders}",
-                                            fgkSSDMODULESPERLADDERLAYER5,
-                                            0,fgkSSDMODULESPERLADDERLAYER5,
-                                            3*fgkSSDLADDERSLAYER5,
-                                            500,500+fgkSSDLADDERSLAYER5);  
+    TH2D *fHistSSDOccupancyThresholdLayer5 = new TH2D("fHistSSDOccupancyThresholdLayer5",
+                                                     ";N_{modules};N_{Ladders}",
+                                                     fgkSSDMODULESPERLADDERLAYER5,
+                                                     0,fgkSSDMODULESPERLADDERLAYER5,
+                                                     3*fgkSSDLADDERSLAYER5,
+                                                     500,500+fgkSSDLADDERSLAYER5);  
     fHistSSDOccupancyThresholdLayer5->SetTitle("Occupancy per module (Layer 5) - Threshold 3%");
     fHistSSDOccupancyThresholdLayer5->GetZaxis()->SetRangeUser(3.0,10.0);
     for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER5 + 1; iBin++){
@@ -512,12 +498,12 @@ void AliITSQASSDDataMakerRec::InitRaws() {
      fAliITSQADataMakerRec->Add2RawsList(fHistSSDOccupancyThresholdLayer5, 
                                         fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
     fSSDRawsOffset += 1;
-    TH2D *fHistSSDOccupancyThresholdLayer6 = new TH2D("SSD/Occupancy/Layer6/fHistSSDOccupancyThresholdLayer6",
-                                            ";N_{modules};N_{Ladders}",
-                                            fgkSSDMODULESPERLADDERLAYER6,
-                                            0,fgkSSDMODULESPERLADDERLAYER6,
-                                            3*fgkSSDLADDERSLAYER6,
-                                            600,600+fgkSSDLADDERSLAYER6);
+    TH2D *fHistSSDOccupancyThresholdLayer6 = new TH2D("fHistSSDOccupancyThresholdLayer6",
+                                                     ";N_{modules};N_{Ladders}",
+                                                     fgkSSDMODULESPERLADDERLAYER6,
+                                                     0,fgkSSDMODULESPERLADDERLAYER6,
+                                                     3*fgkSSDLADDERSLAYER6,
+                                                     600,600+fgkSSDLADDERSLAYER6);
     fHistSSDOccupancyThresholdLayer6->SetTitle("Occupancy per module (Layer 6) - Threshold 3%");
     fHistSSDOccupancyThresholdLayer6->GetZaxis()->SetRangeUser(3.0,10.0);
     for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER6 + 1; iBin++){
@@ -529,12 +515,12 @@ void AliITSQASSDDataMakerRec::InitRaws() {
     fSSDRawsOffset += 1;
 
     //Average occupancy per module
-    TH2D *fHistSSDAverageOccupancyLayer5 = new TH2D("SSD/Occupancy/Layer5/fHistSSDAverageOccupancyLayer5",
-                                            ";N_{modules};N_{Ladders}",
-                                            fgkSSDMODULESPERLADDERLAYER5,
-                                            0,fgkSSDMODULESPERLADDERLAYER5,
-                                            3*fgkSSDLADDERSLAYER5,
-                                            500,500+fgkSSDLADDERSLAYER5);  
+    TH2D *fHistSSDAverageOccupancyLayer5 = new TH2D("fHistSSDAverageOccupancyLayer5",
+                                                   ";N_{modules};N_{Ladders}",
+                                                   fgkSSDMODULESPERLADDERLAYER5,
+                                                   0,fgkSSDMODULESPERLADDERLAYER5,
+                                                   3*fgkSSDLADDERSLAYER5,
+                                                   500,500+fgkSSDLADDERSLAYER5);  
     fHistSSDAverageOccupancyLayer5->SetTitle("Average occupancy per module (Layer 5)");
     fHistSSDAverageOccupancyLayer5->GetZaxis()->SetRangeUser(0.0,5.0);
     for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER5 + 1; iBin++){
@@ -544,12 +530,12 @@ void AliITSQASSDDataMakerRec::InitRaws() {
     fAliITSQADataMakerRec->Add2RawsList(fHistSSDAverageOccupancyLayer5, 
                                        fGenRawsOffset+fSSDRawsOffset);
     fSSDRawsOffset += 1;
-    TH2D *fHistSSDAverageOccupancyLayer6 = new TH2D("SSD/Occupancy/Layer6/fHistSSDAverageOccupancyLayer6",
-                                            ";N_{modules};N_{Ladders}",
-                                            fgkSSDMODULESPERLADDERLAYER6,
-                                            0,fgkSSDMODULESPERLADDERLAYER6,
-                                            3*fgkSSDLADDERSLAYER6,
-                                            600,600+fgkSSDLADDERSLAYER6);
+    TH2D *fHistSSDAverageOccupancyLayer6 = new TH2D("fHistSSDAverageOccupancyLayer6",
+                                                   ";N_{modules};N_{Ladders}",
+                                                   fgkSSDMODULESPERLADDERLAYER6,
+                                                   0,fgkSSDMODULESPERLADDERLAYER6,
+                                                   3*fgkSSDLADDERSLAYER6,
+                                                   600,600+fgkSSDLADDERSLAYER6);
     fHistSSDAverageOccupancyLayer6->SetTitle("Average occupancy per module (Layer 6)");
     fHistSSDAverageOccupancyLayer6->GetZaxis()->SetRangeUser(0.0,5.0);
     for(Int_t iBin = 1; iBin < fgkSSDMODULESPERLADDERLAYER6 + 1; iBin++){
@@ -561,7 +547,7 @@ void AliITSQASSDDataMakerRec::InitRaws() {
     fSSDRawsOffset += 1;
 
     //Output of the DA
-    TH2D *fHistPSideBadChannelMapLayer5 = new TH2D("SSD/BadChannels/fHistPSideBadChannelMapLayer5",
+    TH2D *fHistPSideBadChannelMapLayer5 = new TH2D("fHistPSideBadChannelMapLayer5",
                                                   "Layer 5;N_{module};N_{ladder}",
                                                   22,1,23,
                                                   34,500,534);
@@ -578,7 +564,7 @@ void AliITSQASSDDataMakerRec::InitRaws() {
                                        fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
     fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;
 
-    TH2D *fHistNSideBadChannelMapLayer5 = new TH2D("SSD/BadChannels/fHistNSideBadChannelMapLayer5",
+    TH2D *fHistNSideBadChannelMapLayer5 = new TH2D("fHistNSideBadChannelMapLayer5",
                                                   "Layer 5;N_{module};N_{ladder}",
                                                   22,1,23,
                                                   34,500,534);
@@ -595,7 +581,7 @@ void AliITSQASSDDataMakerRec::InitRaws() {
                                        fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
     fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;
 
-    TH2D *fHistPSideBadChannelMapLayer6 = new TH2D("SSD/BadChannels/fHistPSideBadChannelMapLayer6",
+    TH2D *fHistPSideBadChannelMapLayer6 = new TH2D("fHistPSideBadChannelMapLayer6",
                                                   "Layer 6;N_{module};N_{ladder}",
                                                   25,1,26,
                                                   38,600,638);
@@ -612,7 +598,7 @@ void AliITSQASSDDataMakerRec::InitRaws() {
                                        fGenRawsOffset+fSSDRawsOffset, expert, !image, !saveCorr);
     fSSDRawsOffset += 1; fSSDRawsDAOffset += 1;
 
-    TH2D *fHistNSideBadChannelMapLayer6 = new TH2D("SSD/BadChannels/fHistNSideBadChannelMapLayer6",
+    TH2D *fHistNSideBadChannelMapLayer6 = new TH2D("fHistNSideBadChannelMapLayer6",
                                                   "Layer 6;N_{module};N_{ladder}",
                                                   25,1,26,
                                                   38,600,638);
@@ -699,7 +685,7 @@ void AliITSQASSDDataMakerRec::MakeRaws(AliRawReader* rawReader) {
     sumSSDDataSize += gSizePerDDL[i];
     if(gSizePerDDL[i] > 0) {
       (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+3))->Fill(i+512);
-      (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+5+i))->Fill(TMath::Log10(gSizePerDDL[i]));
+      (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+5+i))->Fill(gSizePerDDL[i]/1e+03);
     }
     //(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+4))->Fill(i+512,gSizePerDDL[i]/1e+06);
   }
@@ -718,14 +704,14 @@ void AliITSQASSDDataMakerRec::MakeRaws(AliRawReader* rawReader) {
       if(i == 2)
        gSizePerLDC[i] = gSizePerDDL[0] + gSizePerDDL[1] + gSizePerDDL[2] +
          gSizePerDDL[14] + gSizePerDDL[15];
-      (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+23+i))->Fill(TMath::Log10(gSizePerLDC[i]));
+      (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+23+i))->Fill(gSizePerLDC[i]/1e+03);
       //cout<<"Event: "<<fSSDEventPerCycle<<" - LDC: "<<i+6<<
       //" - Data size: "<<gSizePerLDC[i]<<endl;
     }
     //(fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+22))->Fill(i+6,gSizePerLDC[i]/1e+06);
   }
   if(sumSSDDataSize) 
-    (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+1))->Fill(TMath::Log10(sumSSDDataSize));
+    (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+1))->Fill(sumSSDDataSize/1e+03);
   if(eventSize)
     (fAliITSQADataMakerRec->GetRawsData(fGenRawsOffset+2))->Fill(100.*sumSSDDataSize/eventSize);
 
@@ -918,12 +904,12 @@ void AliITSQASSDDataMakerRec::MakeDigits(TTree *digits) {
 //  AliITS *fITS  = (AliITS*)gAlice->GetModule("ITS");
 //  fITS->SetTreeAddress();
 //  TClonesArray *iSSDdigits  = fITS->DigitsAddress(2);
-  TBranch *branchD = digits->GetBranch("ITS");
+  TBranch *branchD = digits->GetBranch("ITSDigitsSSD");
   if (!branchD) { 
-    AliError("can't get the branch with the ITS digits !");
+    AliError("can't get the branch with the SSD ITS digits !");
     return;
   }
-  static TClonesArray statDigits("AliITSDigit");
+  static TClonesArray statDigits("AliITSDigitSSD");
   TClonesArray *iSSDdigits = &statDigits;
   branchD->SetAddress(&iSSDdigits);  
   for(Int_t iModule = 500; iModule < 2198; iModule++) {
@@ -954,238 +940,238 @@ void AliITSQASSDDataMakerRec::InitRecPoints()
   Int_t nModuleOffset = 500;
   Int_t nITSTotalModules = AliITSgeomTGeo::GetNModules();
 
-  TH1F *fHistSSDModuleIdLayer5 = new TH1F("SSD/Statistics/fHistSSDModuleIdLayer5",
-                                      "Module Id - Layer 5;Module Id;Entries",
-                                      fgkSSDMODULESLAYER5,
-                                      nModuleOffset - 0.5,
-                                      nITSTotalModules-fgkSSDMODULESLAYER6+0.5);
+  TH1F *fHistSSDModuleIdLayer5 = new TH1F("fHistSSDModuleIdLayer5",
+                                         "Module Id - Layer 5;Module Id;Entries",
+                                         fgkSSDMODULESLAYER5,
+                                         nModuleOffset - 0.5,
+                                         nITSTotalModules-fgkSSDMODULESLAYER6+0.5);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDModuleIdLayer5, 
                                           fGenRecPointsOffset + 0, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDModuleIdLayer6 = new TH1F("SSD/Statistics/fHistSSDModuleIdLayer6",
-                                      "Module Id - Layer 6;Module Id;Entries",
-                                      fgkSSDMODULESLAYER6,
-                                      nModuleOffset+fgkSSDMODULESLAYER5 - 0.5,
-                                      nITSTotalModules + 0.5);
+  TH1F *fHistSSDModuleIdLayer6 = new TH1F("fHistSSDModuleIdLayer6",
+                                         "Module Id - Layer 6;Module Id;Entries",
+                                         fgkSSDMODULESLAYER6,
+                                         nModuleOffset+fgkSSDMODULESLAYER5 - 0.5,
+                                         nITSTotalModules + 0.5);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDModuleIdLayer6, 
                                           fGenRecPointsOffset + 1, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDClusterPerEventLayer5 = new TH1F("SSD/Statistics/fHistSSDClusterPerEventLayer5",
-                                             "N_{clusters} - Layer 5;N_{clusters};Entries;",
-                                             100,0.1,5000);
+  TH1F *fHistSSDClusterPerEventLayer5 = new TH1F("fHistSSDClusterPerEventLayer5",
+                                                "N_{clusters} - Layer 5;N_{clusters};Entries;",
+                                                100,0.1,5000);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterPerEventLayer5,
                                           fGenRecPointsOffset + 2, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDClusterPerEventLayer6 = new TH1F("SSD/Statistics/fHistSSDClusterPerEventLayer6",
-                                             "N_{clusters} - Layer 6;N_{clusters};Entries;",
-                                             100,0.1,5000);
+  TH1F *fHistSSDClusterPerEventLayer6 = new TH1F("fHistSSDClusterPerEventLayer6",
+                                                "N_{clusters} - Layer 6;N_{clusters};Entries;",
+                                                100,0.1,5000);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterPerEventLayer6,
                                           fGenRecPointsOffset + 3, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDLocalXLayer5 = new TH1F("SSD/Coordinates/fHistSSDLocalXLayer5",
-                                    "Local x coord.- Layer 5;x [cm];Entries;",
-                                    100,-4.,4.);
+  TH1F *fHistSSDLocalXLayer5 = new TH1F("fHistSSDLocalXLayer5",
+                                       "Local x coord.- Layer 5;x [cm];Entries;",
+                                       100,-4.,4.);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDLocalXLayer5,
                                           fGenRecPointsOffset + 4, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDLocalXLayer6 = new TH1F("SSD/Coordinates/fHistSSDLocalXLayer6",
-                                    "Local x coord.- Layer 6;x [cm];Entries;",
-                                    100,-4.,4.);
+  TH1F *fHistSSDLocalXLayer6 = new TH1F("fHistSSDLocalXLayer6",
+                                       "Local x coord.- Layer 6;x [cm];Entries;",
+                                       100,-4.,4.);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDLocalXLayer6, 
                                           fGenRecPointsOffset + 5, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDLocalZLayer5 = new TH1F("SSD/Coordinates/fHistSSDLocalZLayer5",
-                                    "Local z coord.- Layer 5;z [cm];Entries;",
-                                    100,-4.,4.);
+  TH1F *fHistSSDLocalZLayer5 = new TH1F("fHistSSDLocalZLayer5",
+                                       "Local z coord.- Layer 5;z [cm];Entries;",
+                                       100,-4.,4.);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDLocalZLayer5, 
                                           fGenRecPointsOffset + 6, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDLocalZLayer6 = new TH1F("SSD/Coordinates/fHistSSDLocalZLayer6",
-                                    "Local z coord.- Layer 6;z [cm];Entries;",
-                                    100,-4.,4.);
+  TH1F *fHistSSDLocalZLayer6 = new TH1F("fHistSSDLocalZLayer6",
+                                       "Local z coord.- Layer 6;z [cm];Entries;",
+                                       100,-4.,4.);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDLocalZLayer6, 
                                           fGenRecPointsOffset + 7, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDGlobalXLayer5 = new TH1F("SSD/Coordinates/fHistSSDGlobalXLayer5",
-                                     "Global x - Layer 5;x [cm];Entries;",
-                                     100,-40.,40.);
+  TH1F *fHistSSDGlobalXLayer5 = new TH1F("fHistSSDGlobalXLayer5",
+                                        "Global x - Layer 5;x [cm];Entries;",
+                                        100,-40.,40.);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalXLayer5, 
                                           fGenRecPointsOffset + 8, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDGlobalXLayer6 = new TH1F("SSD/Coordinates/fHistSSDGlobalXLayer6",
-                                     "Global x - Layer 6;x [cm];Entries;",
-                                     100,-45.,45.);
+  TH1F *fHistSSDGlobalXLayer6 = new TH1F("fHistSSDGlobalXLayer6",
+                                        "Global x - Layer 6;x [cm];Entries;",
+                                        100,-45.,45.);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalXLayer6, 
                                           fGenRecPointsOffset + 9, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDGlobalYLayer5 = new TH1F("SSD/Coordinates/fHistSSDGlobalYLayer5",
-                                     "Global y - Layer 5;y [cm];Entries;",
-                                     100,-40.,40);
+  TH1F *fHistSSDGlobalYLayer5 = new TH1F("fHistSSDGlobalYLayer5",
+                                        "Global y - Layer 5;y [cm];Entries;",
+                                        100,-40.,40);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalYLayer5, 
                                           fGenRecPointsOffset + 10, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDGlobalYLayer6 = new TH1F("SSD/Coordinates/fHistSSDGlobalYLayer6",
-                                     "Global y - Layer 6;y [cm];Entries;",
-                                     100,-45.,45.);
+  TH1F *fHistSSDGlobalYLayer6 = new TH1F("fHistSSDGlobalYLayer6",
+                                        "Global y - Layer 6;y [cm];Entries;",
+                                        100,-45.,45.);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalYLayer6, 
                                           fGenRecPointsOffset + 11, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDGlobalZLayer5 = new TH1F("SSD/Coordinates/fHistSSDGlobalZLayer5",
-                                     "Global z - Layer 5;z [cm];Entries;",
-                                     100,-45.,45);
+  TH1F *fHistSSDGlobalZLayer5 = new TH1F("fHistSSDGlobalZLayer5",
+                                        "Global z - Layer 5;z [cm];Entries;",
+                                        100,-45.,45);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalZLayer5, 
                                           fGenRecPointsOffset + 12, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDGlobalZLayer6 = new TH1F("SSD/Coordinates/fHistSSDGlobalZLayer6",
-                                     "Global z - Layer 6;z [cm];Entries;",
-                                     100,-55.,55.);
+  TH1F *fHistSSDGlobalZLayer6 = new TH1F("fHistSSDGlobalZLayer6",
+                                        "Global z - Layer 6;z [cm];Entries;",
+                                        100,-55.,55.);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDGlobalZLayer6, 
                                           fGenRecPointsOffset + 13, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDPhiLayer5 = new TH1F("SSD/Coordinates/fHistSSDPhiLayer5",
-                                 "#phi - Layer 5;#phi [rad];Entries;",
-                                 100,-TMath::Pi(),TMath::Pi());
+  TH1F *fHistSSDPhiLayer5 = new TH1F("fHistSSDPhiLayer5",
+                                    "#phi - Layer 5;#phi [rad];Entries;",
+                                    100,-TMath::Pi(),TMath::Pi());
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDPhiLayer5, 
                                           fGenRecPointsOffset + 14, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDPhiLayer6 = new TH1F("SSD/Coordinates/fHistSSDPhiLayer6",
-                                 "#phi - Layer 6;#phi [rad];Entries;",
-                                 100,-TMath::Pi(),TMath::Pi());
+  TH1F *fHistSSDPhiLayer6 = new TH1F("fHistSSDPhiLayer6",
+                                    "#phi - Layer 6;#phi [rad];Entries;",
+                                    100,-TMath::Pi(),TMath::Pi());
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDPhiLayer6, 
                                           fGenRecPointsOffset + 15, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDThetaLayer5 = new TH1F("SSD/Coordinates/fHistSSDThetaLayer5",
-                                   "#theta - Layer 5;#theta [rad];Entries;",
-                                   100,-TMath::Pi(),TMath::Pi());
+  TH1F *fHistSSDThetaLayer5 = new TH1F("fHistSSDThetaLayer5",
+                                      "#theta - Layer 5;#theta [rad];Entries;",
+                                      100,-TMath::Pi(),TMath::Pi());
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDThetaLayer5, 
                                           fGenRecPointsOffset + 16, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDThetaLayer6 = new TH1F("SSD/Coordinates/fHistSSDThetaLayer6",
-                                   "#theta - Layer 6;#theta [rad];Entries;",
-                                   100,-TMath::Pi(),TMath::Pi());
+  TH1F *fHistSSDThetaLayer6 = new TH1F("fHistSSDThetaLayer6",
+                                      "#theta - Layer 6;#theta [rad];Entries;",
+                                      100,-TMath::Pi(),TMath::Pi());
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDThetaLayer6, 
                                           fGenRecPointsOffset + 17, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDRadiusLayer5 = new TH1F("SSD/Coordinates/fHistSSDRadiusLayer5",
-                                    "r - Layer 5;r [cm];Entries;",
-                                    100,35.,50.);
+  TH1F *fHistSSDRadiusLayer5 = new TH1F("fHistSSDRadiusLayer5",
+                                       "r - Layer 5;r [cm];Entries;",
+                                       100,35.,50.);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDRadiusLayer5, 
                                           fGenRecPointsOffset + 18, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDRadiusLayer6 = new TH1F("SSD/Coordinates/fHistSSDRadiusLayer6",
-                                    "r - Layer 6;r [cm];Entries;",
-                                    100,35.,50.);
+  TH1F *fHistSSDRadiusLayer6 = new TH1F("fHistSSDRadiusLayer6",
+                                       "r - Layer 6;r [cm];Entries;",
+                                       100,35.,50.);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDRadiusLayer6, 
                                           fGenRecPointsOffset + 19, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDClusterTypeLayer5 = new TH1F("SSD/ClusterCharge/Layer5/fHistSSDClusterTypeLayer5",
-                                         "CL type - Layer 5;Cluster type;Entries;",
-                                         150,0,150);
+  TH1F *fHistSSDClusterTypeLayer5 = new TH1F("fHistSSDClusterTypeLayer5",
+                                            "CL type - Layer 5;Cluster type;Entries;",
+                                            150,0,150);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterTypeLayer5, 
                                           fGenRecPointsOffset + 20, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDClusterTypeLayer6 = new TH1F("SSD/ClusterCharge/Layer6/fHistSSDClusterTypeLayer6",
-                                         "CL type - Layer 6;Cluster type;Entries;",
-                                         150,0,150);
+  TH1F *fHistSSDClusterTypeLayer6 = new TH1F("fHistSSDClusterTypeLayer6",
+                                            "CL type - Layer 6;Cluster type;Entries;",
+                                            150,0,150);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterTypeLayer6, 
                                           fGenRecPointsOffset + 21, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDChargeRatioLayer5 = new TH1F("SSD/ClusterCharge/Layer5/fHistSSDChargeRatioLayer5",
-                                         "Charge ratio - Layer 5;q_{ratio};Entries;",
-                                         100,-2.0,2.0);
+  TH1F *fHistSSDChargeRatioLayer5 = new TH1F("fHistSSDChargeRatioLayer5",
+                                            "Charge ratio - Layer 5;q_{ratio};Entries;",
+                                            100,-2.0,2.0);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeRatioLayer5, 
                                           fGenRecPointsOffset + 22, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDChargeRatioLayer6 = new TH1F("SSD/ClusterCharge/Layer6/fHistSSDChargeRatioLayer6",
-                                         "Charge ratio - Layer 6;q_{ratio};Entries;",
-                                         100,-2.0,2.0);
+  TH1F *fHistSSDChargeRatioLayer6 = new TH1F("fHistSSDChargeRatioLayer6",
+                                            "Charge ratio - Layer 6;q_{ratio};Entries;",
+                                            100,-2.0,2.0);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeRatioLayer6, 
                                           fGenRecPointsOffset + 23, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDChargekeVLayer5 = new TH1F("SSD/ClusterCharge/Layer5/fHistSSDChargekeVLayer5",
-                                       "Charge - Layer 5;q [keV];Entries;",
-                                       100,0.,300.);
+  TH1F *fHistSSDChargekeVLayer5 = new TH1F("fHistSSDChargekeVLayer5",
+                                          "Charge - Layer 5;q [keV];Entries;",
+                                          100,0.,300.);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargekeVLayer5, 
                                           fGenRecPointsOffset + 24, !expert, image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDChargekeVLayer6 = new TH1F("SSD/ClusterCharge/Layer6/fHistSSDChargekeVLayer6",
-                                       "Charge - Layer 6;q [keV];Entries;",
-                                       100,0.,300.);
+  TH1F *fHistSSDChargekeVLayer6 = new TH1F("fHistSSDChargekeVLayer6",
+                                          "Charge - Layer 6;q [keV];Entries;",
+                                          100,0.,300.);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargekeVLayer6, 
                                           fGenRecPointsOffset + 25, !expert, image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDChargePSideLayer5 = new TH1F("SSD/ClusterCharge/Layer5/fHistSSDChargePSideLayer5",
-                                          "Charge P- Layer 5;q_{P} [keV];Entries;",
-                                          100,0.,300.);
+  TH1F *fHistSSDChargePSideLayer5 = new TH1F("fHistSSDChargePSideLayer5",
+                                            "Charge P- Layer 5;q_{P} [keV];Entries;",
+                                            100,0.,300.);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargePSideLayer5,
                                           fGenRecPointsOffset + 26, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDChargePSideLayer6 = new TH1F("SSD/ClusterCharge/Layer6/fHistSSDChargePSideLayer6",
-                                          "Charge P- Layer 6;q_{P} [keV];Entries;",
-                                          100,0.,300.);
+  TH1F *fHistSSDChargePSideLayer6 = new TH1F("fHistSSDChargePSideLayer6",
+                                            "Charge P- Layer 6;q_{P} [keV];Entries;",
+                                            100,0.,300.);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargePSideLayer6,
                                           fGenRecPointsOffset + 27, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDChargeNSideLayer5 = new TH1F("SSD/ClusterCharge/Layer5/fHistSSDChargeNSideLayer5",
-                                          "Charge N- Layer 5;q_{N} [keV];Entries;",
-                                          100,0.,300.);
+  TH1F *fHistSSDChargeNSideLayer5 = new TH1F("fHistSSDChargeNSideLayer5",
+                                            "Charge N- Layer 5;q_{N} [keV];Entries;",
+                                            100,0.,300.);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeNSideLayer5,
                                           fGenRecPointsOffset + 28, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDChargeNSideLayer6 = new TH1F("SSD/ClusterCharge/Layer6/fHistSSDChargeNSideLayer6",
-                                          "Charge N- Layer 6;q_{N} [keV];Entries;",
-                                          100,0.,300.);
+  TH1F *fHistSSDChargeNSideLayer6 = new TH1F("fHistSSDChargeNSideLayer6",
+                                            "Charge N- Layer 6;q_{N} [keV];Entries;",
+                                            100,0.,300.);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeNSideLayer6,
                                           fGenRecPointsOffset + 29, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDChargeRatio2Layer5 = new TH1F("SSD/ClusterCharge/Layer5/fHistSSDChargeRatio2Layer5",
-                                          "Charge Ratio qN/qP - Layer 5;q_{N}/q_{P};Entries;",
-                                          100,0,2);
+  TH1F *fHistSSDChargeRatio2Layer5 = new TH1F("fHistSSDChargeRatio2Layer5",
+                                             "Charge Ratio qN/qP - Layer 5;q_{N}/q_{P};Entries;",
+                                             100,0,2);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeRatio2Layer5,
                                           fGenRecPointsOffset + 30, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH1F *fHistSSDChargeRatio2Layer6 = new TH1F("SSD/ClusterCharge/Layer6/fHistSSDChargeRatio2Layer6",
-                                          "Charge Ratio qN/qP - Layer 6;q_{N}/q_{P};Entries;",
-                                          100,0,2);
+  TH1F *fHistSSDChargeRatio2Layer6 = new TH1F("fHistSSDChargeRatio2Layer6",
+                                             "Charge Ratio qN/qP - Layer 6;q_{N}/q_{P};Entries;",
+                                             100,0,2);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeRatio2Layer6,
                                           fGenRecPointsOffset + 31, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH2F *fHistSSDChargePNSideLayer5 = new TH2F("SSD/ClusterCharge/Layer5/fHistSSDChargePNSideLayer5",
-                                           "Charge correlation - Layer 5;q_{P} [keV];q_{N} [keV]",
-                                           100,0.,300.,
-                                           100,0.,300.);
+  TH2F *fHistSSDChargePNSideLayer5 = new TH2F("fHistSSDChargePNSideLayer5",
+                                             "Charge correlation - Layer 5;q_{P} [keV];q_{N} [keV]",
+                                             100,0.,300.,
+                                             100,0.,300.);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargePNSideLayer5,
                                           fGenRecPointsOffset + 32, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH2F *fHistSSDChargePNSideLayer6 = new TH2F("SSD/ClusterCharge/Layer6/fHistSSDChargePNSideLayer6",
-                                           "Charge correlation - Layer 6;q_{P} [keV];q_{N} [keV]",
-                                           100,0.,300.,
-                                           100,0.,300.);
+  TH2F *fHistSSDChargePNSideLayer6 = new TH2F("fHistSSDChargePNSideLayer6",
+                                             "Charge correlation - Layer 6;q_{P} [keV];q_{N} [keV]",
+                                             100,0.,300.,
+                                             100,0.,300.);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargePNSideLayer6,
                                           fGenRecPointsOffset + 33, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH2F *fHistSSDChargeMapLayer5 = new TH2F("SSD/ClusterCharge/Layer5/fHistSSDChargeMapLayer5",
-                                       "Charge map;N_{modules};N_{Ladders}",
-                                       fgkSSDMODULESPERLADDERLAYER5,
-                                       -0.5,fgkSSDMODULESPERLADDERLAYER5+0.5,
-                                       3*fgkSSDLADDERSLAYER5,
-                                       -0.5,fgkSSDLADDERSLAYER5+0.5);
+  TH2F *fHistSSDChargeMapLayer5 = new TH2F("fHistSSDChargeMapLayer5",
+                                          "Charge map;N_{modules};N_{Ladders}",
+                                          fgkSSDMODULESPERLADDERLAYER5,
+                                          -0.5,fgkSSDMODULESPERLADDERLAYER5+0.5,
+                                          3*fgkSSDLADDERSLAYER5,
+                                          -0.5,fgkSSDLADDERSLAYER5+0.5);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeMapLayer5, 
                                           fGenRecPointsOffset + 34, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH2F *fHistSSDChargeMapLayer6 = new TH2F("SSD/ClusterCharge/Layer6/fHistSSDChargeMapLayer6",
-                                       "Charge map;N_{modules};N_{Ladders}",
-                                       fgkSSDMODULESPERLADDERLAYER6,
-                                       -0.5,fgkSSDMODULESPERLADDERLAYER6+0.5,
-                                       3*fgkSSDLADDERSLAYER6,
-                                       -0.5,fgkSSDLADDERSLAYER6+0.5);
+  TH2F *fHistSSDChargeMapLayer6 = new TH2F("fHistSSDChargeMapLayer6",
+                                          "Charge map;N_{modules};N_{Ladders}",
+                                          fgkSSDMODULESPERLADDERLAYER6,
+                                          -0.5,fgkSSDMODULESPERLADDERLAYER6+0.5,
+                                          3*fgkSSDLADDERSLAYER6,
+                                          -0.5,fgkSSDLADDERSLAYER6+0.5);
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDChargeMapLayer6, 
                                           fGenRecPointsOffset + 35, expert, !image);
   fSSDhRecPointsTask += 1;
-  TH2F *fHistSSDClusterMapLayer5 = new TH2F("SSD/Statistics/Layer5/fHistSSDClusterMapLayer5",
-                                         "Layer 5;N_{module};N_{ladder}",
-                                         22,1,23,
-                                         34,500,534);
+  TH2F *fHistSSDClusterMapLayer5 = new TH2F("fHistSSDClusterMapLayer5",
+                                           "Layer 5;N_{module};N_{ladder}",
+                                           22,1,23,
+                                           34,500,534);
   fHistSSDClusterMapLayer5->GetXaxis()->SetTitleColor(1);
   fHistSSDClusterMapLayer5->SetStats(kFALSE);
   fHistSSDClusterMapLayer5->GetYaxis()->SetTitleOffset(1.8);
@@ -1198,10 +1184,10 @@ void AliITSQASSDDataMakerRec::InitRecPoints()
   fAliITSQADataMakerRec->Add2RecPointsList(fHistSSDClusterMapLayer5,
                                           fGenRecPointsOffset + 36, !expert, image);
   fSSDhRecPointsTask += 1;
-  TH2F *fHistSSDClusterMapLayer6 = new TH2F("SSD/Statistics/Layer6/fHistSSDClusterMapLayer6",
-                                         "Layer 6;N_{module};N_{ladder}",
-                                         25,1,26,
-                                         38,600,638);
+  TH2F *fHistSSDClusterMapLayer6 = new TH2F("fHistSSDClusterMapLayer6",
+                                           "Layer 6;N_{module};N_{ladder}",
+                                           25,1,26,
+                                           38,600,638);
   fHistSSDClusterMapLayer6->GetXaxis()->SetTitleColor(1);
   fHistSSDClusterMapLayer6->SetStats(kFALSE);
   fHistSSDClusterMapLayer6->GetYaxis()->SetTitleOffset(1.8);
@@ -1259,6 +1245,9 @@ void AliITSQASSDDataMakerRec::MakeRecPoints(TTree *clustersTree)
       Double_t chargeNSide = clusterCharge*(1. - chargeRatio);
       if(layer == 4) {
        //printf("-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints Filling 4 called \n");
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 20)->Fill(recp->GetType());
+
+       if(recp->GetType() != 1) continue;
        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 0)->Fill(module);
        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 4)->Fill(recp->GetDetLocalX());
        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 6)->Fill(recp->GetDetLocalZ());
@@ -1268,7 +1257,6 @@ void AliITSQASSDDataMakerRec::MakeRecPoints(TTree *clustersTree)
        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 14)->Fill(phi);
        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 16)->Fill(theta);
        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 18)->Fill(radius);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 20)->Fill(recp->GetType());
        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 22)->Fill(recp->GetChargeRatio());
        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 24)->Fill(recp->GetQ());
        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 26)->Fill(chargePSide);
@@ -1281,6 +1269,9 @@ void AliITSQASSDDataMakerRec::MakeRecPoints(TTree *clustersTree)
       }//layer 5 histograms
       if(layer == 5) {
        //printf("-*-*-*-*-*-***************AliITSQASSDataMakerRec::MakeRecpoints Filling 5 called \n");
+       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 21)->Fill(recp->GetType());
+
+       if(recp->GetType() != 1) continue;
        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 1)->Fill(module);
        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 5)->Fill(recp->GetDetLocalX());
        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 7)->Fill(recp->GetDetLocalZ());
@@ -1290,7 +1281,6 @@ void AliITSQASSDDataMakerRec::MakeRecPoints(TTree *clustersTree)
        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 15)->Fill(phi);
        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 17)->Fill(theta);
        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 19)->Fill(radius);
-       fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 21)->Fill(recp->GetType());
        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 23)->Fill(recp->GetChargeRatio());
        fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 25)->Fill(recp->GetQ());
         fAliITSQADataMakerRec->GetRecPointsData(fGenRecPointsOffset + 27)->Fill(chargePSide);
index 48de1a28e2b6fc49fcce9eaae4f3f9d3f7eb9367..e297a7d97b89e457ac91bfa696dcffb9636697d9 100644 (file)
@@ -1,17 +1,17 @@
 /**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- *                                                                        *
- * Author: The ALICE Off-line Project.                                    *
- * Contributors are mentioned in the code where appropriate.              *
- *                                                                        *
- * Permission to use, copy, modify and distribute this software and its   *
- * documentation strictly for non-commercial purposes is hereby granted   *
- * without fee, provided that the above copyright notice appears in all   *
- * copies and that both the copyright notice and this permission notice   *
- * appear in the supporting documentation. The authors make no claims     *
- * about the suitability of this software for any purpose. It is          *
- * provided "as is" without express or implied warranty.                  *
- **************************************************************************/
+* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+*                                                                        *
+* Author: The ALICE Off-line Project.                                    *
+* Contributors are mentioned in the code where appropriate.              *
+*                                                                        *
+* Permission to use, copy, modify and distribute this software and its   *
+* documentation strictly for non-commercial purposes is hereby granted   *
+* without fee, provided that the above copyright notice appears in all   *
+* copies and that both the copyright notice and this permission notice   *
+* appear in the supporting documentation. The authors make no claims     *
+* about the suitability of this software for any purpose. It is          *
+* provided "as is" without express or implied warranty.                  *
+**************************************************************************/
 
 /* $Id$ */
 
@@ -34,6 +34,8 @@
 #include "AliITSgeom.h"
 #include "AliITSsimulationSSD.h"
 #include "AliITSTableSSD.h"
+#include <TF1.h>
+
 
 ClassImp(AliITSsimulationSSD)
 ////////////////////////////////////////////////////////////////////////
@@ -52,13 +54,13 @@ fMapA2(0),
 fIonE(0.0),
 fDifConst(),
 fDriftVel(){
-    //default Constructor
-    //Inputs:
-    // none.
-    // Outputs:
-    // none.
-    // Return:
-    //  A default construction AliITSsimulationSSD class
+   //default Constructor
+   //Inputs:
+   // none.
+   // Outputs:
+   // none.
+   // Return:
+   //  A default construction AliITSsimulationSSD class
 }
 //----------------------------------------------------------------------
 AliITSsimulationSSD::AliITSsimulationSSD(AliITSDetTypeSim* dettyp):
@@ -67,583 +69,599 @@ AliITSsimulation(dettyp),
 fMapA2(0),
 fIonE(0.0),
 fDifConst(),
-fDriftVel(){
-    // Constructor 
-    // Input:
-    //   AliITSDetTypeSim    Pointer to the SSD dettype to be used
-    // Outputs:
-    //   none.
-    // Return
-    //   A standard constructed AliITSsimulationSSD class
-
-    Init();
+fDriftVel(),
+fTimeResponse(0){
+   // Constructor 
+   // Input:
+   //   AliITSDetTypeSim    Pointer to the SSD dettype to be used
+   // Outputs:
+   //   none.
+   // Return
+   //   A standard constructed AliITSsimulationSSD class
+
+ fTimeResponse = new TF1("ftimeresponse",".5*x*exp(1.-.5*x)");
+   Init();
 }
 //----------------------------------------------------------------------
 void AliITSsimulationSSD::Init(){
 // Inilizer, Inilizes all of the variable as needed in a standard place.
 // Input:
 //   AliITSsegmentationSSD *seg  Pointer to the SSD segmentation to be used
 //   AliITSCalibrationSSD   *resp Pointer to the SSD responce class to be used
 // Outputs:
 //   none.
 // Return
 //   none.
 AliITSsegmentationSSD* seg = (AliITSsegmentationSSD*)GetSegmentationModel(2);
-  
 SetDriftVelocity(); // use default values in .h file
 SetIonizeE();       // use default values in .h file
 SetDiffConst();     // use default values in .h file
 fpList           = new AliITSpList(2,GetNStrips());
 fMapA2           = new AliITSMapA2(seg);
+ // Inilizer, Inilizes all of the variable as needed in a standard place.
+ // Input:
+ //   AliITSsegmentationSSD *seg  Pointer to the SSD segmentation to be used
+ //   AliITSCalibrationSSD   *resp Pointer to the SSD responce class to be used
+ // Outputs:
+ //   none.
+ // Return
+ //   none.
+ AliITSsegmentationSSD* seg = (AliITSsegmentationSSD*)GetSegmentationModel(2);
+
+ SetDriftVelocity(); // use default values in .h file
+ SetIonizeE();       // use default values in .h file
+ SetDiffConst();     // use default values in .h file
+ fpList           = new AliITSpList(2,GetNStrips());
+ fMapA2           = new AliITSMapA2(seg);
 }
 //______________________________________________________________________
 AliITSsimulationSSD& AliITSsimulationSSD::operator=(
-                                         const AliITSsimulationSSD &s){
-  // Operator =
-
-  if(this==&s) return *this;
-
-  //  this->fDCS         = new AliITSdcsSSD(*(s.fDCS));
-  this->fMapA2       = s.fMapA2;
-  this->fIonE        = s.fIonE;
-  this->fDifConst[0] = s.fDifConst[0];
-  this->fDifConst[1] = s.fDifConst[1];
-  this->fDriftVel[0] = s.fDriftVel[0];
-  this->fDriftVel[1] = s.fDriftVel[1];
-  return *this;
+                                        const AliITSsimulationSSD &s){
+ // Operator =
+
+ if(this==&s) return *this;
+
+ //  this->fDCS         = new AliITSdcsSSD(*(s.fDCS));
+ this->fMapA2       = s.fMapA2;
+ this->fIonE        = s.fIonE;
+ this->fDifConst[0] = s.fDifConst[0];
+ this->fDifConst[1] = s.fDifConst[1];
+ this->fDriftVel[0] = s.fDriftVel[0];
+ this->fDriftVel[1] = s.fDriftVel[1];
+ this->fTimeResponse = s.fTimeResponse;
+ return *this;
 }
 /*
 //______________________________________________________________________
 AliITSsimulation& AliITSsimulationSSD::operator=(
-                                         const AliITSsimulation &s){
 // Operator =
+                                        const AliITSsimulation &s){
+ // Operator =
 
 if(this==&s) return *this;
 Error("AliITSsimulationSSD","Not allowed to make a = with "
+ if(this==&s) return *this;
+ Error("AliITSsimulationSSD","Not allowed to make a = with "
        "AliITSsimulationSSD Using default creater instead");
-  
 return *this;
+
+ return *this;
 }
 */
 //______________________________________________________________________
 AliITSsimulationSSD::AliITSsimulationSSD(const AliITSsimulationSSD &source):
-    AliITSsimulation(source),
+   AliITSsimulation(source),
 fMapA2(source.fMapA2),
 fIonE(source.fIonE),
 fDifConst(),
-fDriftVel(){
-  // copy constructor
-  fDifConst[0] = source.fDifConst[0];
-  fDifConst[1] = source.fDifConst[1];
-  fDriftVel[0] = source.fDriftVel[0];
-  fDriftVel[1] = source.fDriftVel[1];
+fDriftVel(),
+fTimeResponse(source.fTimeResponse){
+ // copy constructor
+ fDifConst[0] = source.fDifConst[0];
+ fDifConst[1] = source.fDifConst[1];
+ fDriftVel[0] = source.fDriftVel[0];
+ fDriftVel[1] = source.fDriftVel[1];
 }
 //______________________________________________________________________
 AliITSsimulationSSD::~AliITSsimulationSSD() {
-  // destructor
-  delete fMapA2;
-  //delete fDCS;
+ // destructor
+ delete fMapA2;
+ delete fTimeResponse;
+ //delete fDCS;
 }
 //______________________________________________________________________
 void AliITSsimulationSSD::InitSimulationModule(Int_t module,Int_t event){
-    // Creates maps to build the list of tracks for each sumable digit
-    // Inputs:
-    //   Int_t module    // Module number to be simulated
-    //   Int_t event     // Event number to be simulated
-    // Outputs:
-    //   none.
-    // Return
-    //    none.
-
-    SetModuleNumber(module);
-    SetEventNumber(event);
-    fMapA2->ClearMap();
-    fpList->ClearMap();
+   // Creates maps to build the list of tracks for each sumable digit
+   // Inputs:
+   //   Int_t module    // Module number to be simulated
+   //   Int_t event     // Event number to be simulated
+   // Outputs:
+   //   none.
+   // Return
+   //    none.
+
+   SetModuleNumber(module);
+   SetEventNumber(event);
+   fMapA2->ClearMap();
+   fpList->ClearMap();
 }
 //______________________________________________________________________
 void AliITSsimulationSSD::FinishSDigitiseModule(){
-    // Does the Sdigits to Digits work
-    // Inputs:
-    //   none.
-    // Outputs:
-    //   none.
-    // Return:
-    //   none.
-
 FillMapFrompList(fpList);  // need to check if needed here or not????
 SDigitToDigit(fModule,fpList);
 fpList->ClearMap();
 fMapA2->ClearMap();
+   // Does the Sdigits to Digits work
+   // Inputs:
+   //   none.
+   // Outputs:
+   //   none.
+   // Return:
+   //   none.
+
+ FillMapFrompList(fpList);  // need to check if needed here or not????
+ SDigitToDigit(fModule,fpList);
+ fpList->ClearMap();
+ fMapA2->ClearMap();
 }
 //______________________________________________________________________
 void AliITSsimulationSSD::DigitiseModule(AliITSmodule *mod,Int_t,Int_t) {
 // Digitizes hits for one SSD module
 SetModuleNumber(mod->GetIndex());
-  
 HitsToAnalogDigits(mod,fpList);
 SDigitToDigit(GetModuleNumber(),fpList);
-  
 fpList->ClearMap();
 fMapA2->ClearMap();
+ // Digitizes hits for one SSD module
+ SetModuleNumber(mod->GetIndex());
+
+ HitsToAnalogDigits(mod,fpList);
+ SDigitToDigit(GetModuleNumber(),fpList);
+
+ fpList->ClearMap();
+ fMapA2->ClearMap();
 }
 //______________________________________________________________________
 void AliITSsimulationSSD::SDigitiseModule(AliITSmodule *mod,Int_t,Int_t) {
-  // Produces Summable/Analog digits and writes them to the SDigit tree. 
+ // Produces Summable/Analog digits and writes them to the SDigit tree. 
+
+   HitsToAnalogDigits(mod,fpList);
 
-    HitsToAnalogDigits(mod,fpList);
+   WriteSDigits(fpList);
 
-    WriteSDigits(fpList);
-    
-    fpList->ClearMap();
-    fMapA2->ClearMap();
+   fpList->ClearMap();
+   fMapA2->ClearMap();
 }
 //______________________________________________________________________
 void AliITSsimulationSSD::SDigitToDigit(Int_t module,AliITSpList *pList){
 // Takes the pList and finishes the digitization.
-  
 ApplyNoise(pList,module);
 ApplyCoupling(pList,module);
 ApplyDeadChannels(module);
-  
 ChargeToSignal(module,pList);
+ // Takes the pList and finishes the digitization.
+
+ ApplyNoise(pList,module);
+ ApplyCoupling(pList,module);
+ ApplyDeadChannels(module);
+
+ ChargeToSignal(module,pList);
 }
 //______________________________________________________________________
 void AliITSsimulationSSD::HitsToAnalogDigits(AliITSmodule *mod,
-                                             AliITSpList *pList){
-    // Loops over all hits to produce Analog/floating point digits. This
-    // is also the first task in producing standard digits.
-  Int_t lasttrack     = -2;
-  Int_t idtrack       = -2;
-  Double_t x0=0.0, y0=0.0, z0=0.0;
-  Double_t x1=0.0, y1=0.0, z1=0.0;
-  Double_t de=0.0;
-  Int_t module = mod->GetIndex();
-  
-  AliITSsegmentationSSD* seg = (AliITSsegmentationSSD*)GetSegmentationModel(2);
-  
-  TObjArray *hits = mod->GetHits();
-  Int_t nhits     = hits->GetEntriesFast();
-  if (nhits<=0) return;
-  AliITSTableSSD * tav = new AliITSTableSSD(GetNStrips());
-  module = mod->GetIndex();
-  if ( mod->GetLayer() == 6 ) seg->SetLayer(6);
-  if ( mod->GetLayer() == 5 ) seg->SetLayer(5);
-  for(Int_t i=0; i<nhits; i++) {    
-    // LineSegmentL returns 0 if the hit is entering
-    // If hits is exiting returns positions of entering and exiting hits
-    // Returns also energy loss
-    if(GetDebug(4)){
-      cout << i << " ";
-      cout << mod->GetHit(i)->GetXL() << " "<<mod->GetHit(i)->GetYL();
-      cout << " " << mod->GetHit(i)->GetZL();
-      cout << endl;
-    } // end if
-    if (mod->LineSegmentL(i, x0, x1, y0, y1, z0, z1, de, idtrack)) {
-      HitToDigit(module, x0, y0, z0, x1, y1, z1, de,tav);
-      if (lasttrack != idtrack || i==(nhits-1)) {
+                                            AliITSpList *pList){
+   // Loops over all hits to produce Analog/floating point digits. This
+   // is also the first task in producing standard digits.
+ Int_t lasttrack     = -2;
+ Int_t idtrack       = -2;
+ Double_t x0=0.0, y0=0.0, z0=0.0;
+ Double_t x1=0.0, y1=0.0, z1=0.0;
+ Double_t de=0.0;
+ Int_t module = mod->GetIndex();
+ Double_t tof = 0.;
+
+
+ AliITSsegmentationSSD* seg = (AliITSsegmentationSSD*)GetSegmentationModel(2);
+
+ TObjArray *hits = mod->GetHits();
+ Int_t nhits     = hits->GetEntriesFast();
+ if (nhits<=0) return;
+ AliITSTableSSD * tav = new AliITSTableSSD(GetNStrips());
+ module = mod->GetIndex();
+ if ( mod->GetLayer() == 6 ) seg->SetLayer(6);
+ if ( mod->GetLayer() == 5 ) seg->SetLayer(5);
+ for(Int_t i=0; i<nhits; i++) {    
+   // LineSegmentL returns 0 if the hit is entering
+   // If hits is exiting returns positions of entering and exiting hits
+   // Returns also energy loss
+   if(GetDebug(4)){
+     cout << i << " ";
+     cout << mod->GetHit(i)->GetXL() << " "<<mod->GetHit(i)->GetYL();
+     cout << " " << mod->GetHit(i)->GetZL();
+     cout << endl;
+   } // end if
+   if (mod->LineSegmentL(i, x0, x1, y0, y1, z0, z1, de, idtrack)) {
+
+     // Scale down dE/dx according to the hit's TOF wrt to the trigger
+     // Necessary for pileup simulation
+     // EF - 21/04/09
+     tof = mod->GetHit(i)->GetTOF();
+     tof *= 1.E+6; // convert time in microsecond
+     de = de * fTimeResponse->Eval(-1.*tof+2.);
+     //
+
+     HitToDigit(module, x0, y0, z0, x1, y1, z1, de,tav);
+     if (lasttrack != idtrack || i==(nhits-1)) {
        GetList(idtrack,i,module,pList,tav);
-      } // end if
-      lasttrack=idtrack;
-    } // end if
 }  // end loop over hits
 delete tav; tav=0;
 return;
+     } // end if
+     lasttrack=idtrack;
+   } // end if
+ }  // end loop over hits
+ delete tav; tav=0;
+ return;
 }
 //----------------------------------------------------------------------
 void AliITSsimulationSSD::HitToDigit(Int_t module, Double_t x0, Double_t y0, 
-                                     Double_t z0, Double_t x1, Double_t y1, 
-                                     Double_t z1, Double_t de,
-                                     AliITSTableSSD *tav) {
-  
 // hit to digit conversion
-  
 AliITSsegmentationSSD* seg = (AliITSsegmentationSSD*)GetSegmentationModel(2);
 // Turns hits in SSD module into one or more digits.
 //Float_t tang[2] = {0.0,0.0};
 //seg->Angles(tang[0], tang[1]);//stereo<<->tan(stereo)~=stereo
 Double_t x, y, z;
 Double_t dex=0.0, dey=0.0, dez=0.0; 
 Double_t pairs; // pair generation energy per step.
 Double_t sigma[2] = {0.,0.};// standard deviation of the diffusion gaussian
 Double_t tdrift[2] = {0.,0.}; // time of drift
 Double_t w;
 Double_t inf[2], sup[2], par0[2];                 
-  
 // Steps in the module are determined "manually" (i.e. No Geant)
 // NumOfSteps divide path between entering and exiting hits in steps 
 Int_t numOfSteps = NumOfSteps(x1, y1, z1, dex, dey, dez);
 // Enery loss is equally distributed among steps
 de    = de/numOfSteps;
 pairs = de/GetIonizeE(); // e-h pairs generated
-
 //-----------------------------------------------------
 // stepping
 //-----------------------------------------------------
 for(Int_t j=0; j<numOfSteps; j++) {     // stepping
-
-    x = x0 + (j+0.5)*dex;
-    y = y0 + (j+0.5)*dey;
-    if ( y > (seg->Dy()/2+10)*1.0E-4 ) {
-      // check if particle is within the detector
-      Warning("HitToDigit",
+                                    Double_t z0, Double_t x1, Double_t y1, 
+                                    Double_t z1, Double_t de,
+                                    AliITSTableSSD *tav) {
+
+ // hit to digit conversion
+
+ AliITSsegmentationSSD* seg = (AliITSsegmentationSSD*)GetSegmentationModel(2);
+ // Turns hits in SSD module into one or more digits.
+ //Float_t tang[2] = {0.0,0.0};
+ //seg->Angles(tang[0], tang[1]);//stereo<<->tan(stereo)~=stereo
+ Double_t x, y, z;
+ Double_t dex=0.0, dey=0.0, dez=0.0; 
+ Double_t pairs; // pair generation energy per step.
+ Double_t sigma[2] = {0.,0.};// standard deviation of the diffusion gaussian
+ Double_t tdrift[2] = {0.,0.}; // time of drift
+ Double_t w;
+ Double_t inf[2], sup[2], par0[2];                 
+
+ // Steps in the module are determined "manually" (i.e. No Geant)
+ // NumOfSteps divide path between entering and exiting hits in steps 
+ Int_t numOfSteps = NumOfSteps(x1, y1, z1, dex, dey, dez);
+ // Enery loss is equally distributed among steps
+ de    = de/numOfSteps;
+ pairs = de/GetIonizeE(); // e-h pairs generated
+
+ //-----------------------------------------------------
+ // stepping
+ //-----------------------------------------------------
+ for(Int_t j=0; j<numOfSteps; j++) {     // stepping
+
+   x = x0 + (j+0.5)*dex;
+   y = y0 + (j+0.5)*dey;
+   if ( y > (seg->Dy()/2+10)*1.0E-4 ) {
+     // check if particle is within the detector
+     Warning("HitToDigit",
              "hit out of detector y0=%e,y=%e,dey=%e,j =%d module=%d,  exceed=%e",
              y0,y,dey,j,module, y-(seg->Dy()/2+10)*1.0E-4);
-      return;
-    } // end if
-    z = z0 + (j+0.5)*dez;
+     return;
+   } // end if
+   z = z0 + (j+0.5)*dez;
 
-    if(GetDebug(4)) cout <<"HitToDigit "<<x<<" "<<y<<" "<<z<< " "
+   if(GetDebug(4)) cout <<"HitToDigit "<<x<<" "<<y<<" "<<z<< " "
                         <<dex<<" "<<dey<<" "<<dez<<endl;
 
-    if(seg->GetLayer()==6) {
-      y=-y; // Lay6 module has sensor up-side-down!!!
-    }
-    
-    // w is the coord. perpendicular to the strips
-    //    Float_t xp=x*1.e+4,zp=z*1.e+4; // microns    
-    Float_t xp=x,zp=z; 
-    seg->GetPadTxz(xp,zp);
-
-    Int_t k;
-    //---------------------------------------------------------
-    // Pside
-    //------------------------------------------------------------
-    k=0;
-    
-    // calculate drift time
-    // y is the minimum path
-    tdrift[0] = (y+(seg->Dy()*1.0E-4)/2)/GetDriftVelocity(0);
-    
-    w = xp; // P side strip number
-    
-    if((w<(-0.5)) || (w>(GetNStrips()-0.5))) {
-      // this check rejects hits in regions not covered by strips
-      // 0.5 takes into account boundaries 
-      if(GetDebug(4)) cout << "Dead SSD region, x,z="<<x<<","<<z<<endl;
-      return; // There are dead region on the SSD sensitive volume!!!
-    } // end if
-    
-      // sigma is the standard deviation of the diffusion gaussian
-    if(tdrift[k]<0) return;
-    
-    sigma[k] = TMath::Sqrt(2*GetDiffConst(k)*tdrift[k]);
-    sigma[k] /= (GetStripPitch()*1.0E-4);  //units of Pitch
-    
-    if(sigma[k]==0.0) {        
-      Error("HitToDigit"," sigma[%d]=0",k);
-      exit(0);
-    } // end if
-    
-    par0[k] = pairs;
-    // we integrate the diffusion gaussian from -3sigma to 3sigma 
-    inf[k] = w - 3*sigma[k]; // 3 sigma from the gaussian average  
-    sup[k] = w + 3*sigma[k]; // 3 sigma from the gaussian average
-    // IntegrateGaussian does the actual
-    // integration of diffusion gaussian
-    IntegrateGaussian(k, par0[k], w, sigma[k], inf[k], sup[k],tav);
-    
-    //------------------------------------------------------
-    // end Pside
-    //-------------------------------------------------------
-    
-    //------------------------------------------------------
-    // Nside
-    //-------------------------------------------------------
-    k=1;
-    tdrift[1] = ((seg->Dy()*1.0E-4)/2-y)/GetDriftVelocity(1);
-    
-    //tang[k]=TMath::Tan(tang[k]);
-    
-    w = zp; // N side strip number
-    
-    if((w<(-0.5)) || (w>(GetNStrips()-0.5))) {
-      // this check rejects hits in regions not covered by strips
-      // 0.5 takes into account boundaries 
-      if(GetDebug(4)) cout << "Dead SSD region, x,z="<<x<<","<<z<<endl;
-      return; // There are dead region on the SSD sensitive volume.
-    } // end if
-    
-      // sigma is the standard deviation of the diffusion gaussian
-    if(tdrift[k]<0) return;
-    
-    sigma[k] = TMath::Sqrt(2*GetDiffConst(k)*tdrift[k]);
-    sigma[k] /= (GetStripPitch()*1.0E-4);  //units of Pitch
-    
-    if(sigma[k]==0.0) {        
-      Error("HitToDigit"," sigma[%d]=0",k);
-      exit(0);
-    } // end if
-    
-    par0[k] = pairs;
-    // we integrate the diffusion gaussian from -3sigma to 3sigma 
-    inf[k] = w - 3*sigma[k]; // 3 sigma from the gaussian average  
-    sup[k] = w + 3*sigma[k]; // 3 sigma from the gaussian average
-    // IntegrateGaussian does the actual
-    // integration of diffusion gaussian
-    IntegrateGaussian(k, par0[k], w, sigma[k], inf[k], sup[k],tav);
-    
-    //-------------------------------------------------
-    // end Nside
-    //-------------------------------------------------
-    
-    
 } // end stepping
+   if(seg->GetLayer()==6) {
+     y=-y; // Lay6 module has sensor up-side-down!!!
+   }
+
+   // w is the coord. perpendicular to the strips
+   //    Float_t xp=x*1.e+4,zp=z*1.e+4; // microns    
+   Float_t xp=x,zp=z; 
+   seg->GetPadTxz(xp,zp);
+
+   Int_t k;
+   //---------------------------------------------------------
+   // Pside
+   //------------------------------------------------------------
+   k=0;
+
+   // calculate drift time
+   // y is the minimum path
+   tdrift[0] = (y+(seg->Dy()*1.0E-4)/2)/GetDriftVelocity(0);
+
+   w = xp; // P side strip number
+
+   if((w<(-0.5)) || (w>(GetNStrips()-0.5))) {
+     // this check rejects hits in regions not covered by strips
+     // 0.5 takes into account boundaries 
+     if(GetDebug(4)) cout << "Dead SSD region, x,z="<<x<<","<<z<<endl;
+     return; // There are dead region on the SSD sensitive volume!!!
+   } // end if
+
+     // sigma is the standard deviation of the diffusion gaussian
+   if(tdrift[k]<0) return;
+
+   sigma[k] = TMath::Sqrt(2*GetDiffConst(k)*tdrift[k]);
+   sigma[k] /= (GetStripPitch()*1.0E-4);  //units of Pitch
+
+   if(sigma[k]==0.0) {         
+     Error("HitToDigit"," sigma[%d]=0",k);
+     exit(0);
+   } // end if
+
+   par0[k] = pairs;
+   // we integrate the diffusion gaussian from -3sigma to 3sigma 
+   inf[k] = w - 3*sigma[k]; // 3 sigma from the gaussian average  
+   sup[k] = w + 3*sigma[k]; // 3 sigma from the gaussian average
+   // IntegrateGaussian does the actual
+   // integration of diffusion gaussian
+   IntegrateGaussian(k, par0[k], w, sigma[k], inf[k], sup[k],tav);
+
+   //------------------------------------------------------
+   // end Pside
+   //-------------------------------------------------------
+
+   //------------------------------------------------------
+   // Nside
+   //-------------------------------------------------------
+   k=1;
+   tdrift[1] = ((seg->Dy()*1.0E-4)/2-y)/GetDriftVelocity(1);
+
+   //tang[k]=TMath::Tan(tang[k]);
+
+   w = zp; // N side strip number
+
+   if((w<(-0.5)) || (w>(GetNStrips()-0.5))) {
+     // this check rejects hits in regions not covered by strips
+     // 0.5 takes into account boundaries 
+     if(GetDebug(4)) cout << "Dead SSD region, x,z="<<x<<","<<z<<endl;
+     return; // There are dead region on the SSD sensitive volume.
+   } // end if
+
+     // sigma is the standard deviation of the diffusion gaussian
+   if(tdrift[k]<0) return;
+
+   sigma[k] = TMath::Sqrt(2*GetDiffConst(k)*tdrift[k]);
+   sigma[k] /= (GetStripPitch()*1.0E-4);  //units of Pitch
+
+   if(sigma[k]==0.0) {         
+     Error("HitToDigit"," sigma[%d]=0",k);
+     exit(0);
+   } // end if
+
+   par0[k] = pairs;
+   // we integrate the diffusion gaussian from -3sigma to 3sigma 
+   inf[k] = w - 3*sigma[k]; // 3 sigma from the gaussian average  
+   sup[k] = w + 3*sigma[k]; // 3 sigma from the gaussian average
+   // IntegrateGaussian does the actual
+   // integration of diffusion gaussian
+   IntegrateGaussian(k, par0[k], w, sigma[k], inf[k], sup[k],tav);
+
+   //-------------------------------------------------
+   // end Nside
+   //-------------------------------------------------
+
+
+ } // end stepping
 }
 
 //______________________________________________________________________
 void AliITSsimulationSSD::ApplyNoise(AliITSpList *pList,Int_t module){
 // Apply Noise.
 Int_t ix;
 Double_t signal,noise;
 AliITSCalibrationSSD* res =(AliITSCalibrationSSD*)GetCalibrationModel(module);
-   
 // Pside
 for(ix=0;ix<GetNStrips();ix++){      // loop over strips
-    
-    // noise is gaussian
-    noise  = (Double_t) gRandom->Gaus(0,res->GetNoiseP(ix));
-    
-    // need to calibrate noise 
-    // NOTE. noise from the calibration database comes uncalibrated, 
-    // it needs to be calibrated in order to be added
-    // to the signal. It will be decalibrated later on together with the noise    
-    noise *= (Double_t) res->GetGainP(ix); 
-    
-    // noise comes in ADC channels from the calibration database
-    // It needs to be converted back to electronVolts
-    noise /= res->GetSSDDEvToADC(1.);
-    
-    // Finally, noise is added to the signal
-    signal = noise + fMapA2->GetSignal(0,ix);//get signal from map
-    fMapA2->SetHit(0,ix,signal); // give back signal to map
-    if(signal>0.0) pList->AddNoise(0,ix,module,noise);
 } // loop over strip 
-  
-    // Nside
 for(ix=0;ix<GetNStrips();ix++){      // loop over strips
-    noise  = (Double_t) gRandom->Gaus(0,res->GetNoiseN(ix));// give noise to signal
-    noise *= (Double_t) res->GetGainN(ix); 
-    noise /= res->GetSSDDEvToADC(1.);
-    signal = noise + fMapA2->GetSignal(1,ix);//get signal from map
-    fMapA2->SetHit(1,ix,signal); // give back signal to map
-    if(signal>0.0) pList->AddNoise(1,ix,module,noise);
 } // loop over strip 
-  
+ // Apply Noise.
+ Int_t ix;
+ Double_t signal,noise;
+ AliITSCalibrationSSD* res =(AliITSCalibrationSSD*)GetCalibrationModel(module);
+
+ // Pside
+ for(ix=0;ix<GetNStrips();ix++){      // loop over strips
+
+   // noise is gaussian
+   noise  = (Double_t) gRandom->Gaus(0,res->GetNoiseP(ix));
+
+   // need to calibrate noise 
+   // NOTE. noise from the calibration database comes uncalibrated, 
+   // it needs to be calibrated in order to be added
+   // to the signal. It will be decalibrated later on together with the noise    
+   noise *= (Double_t) res->GetGainP(ix); 
+
+   // noise comes in ADC channels from the calibration database
+   // It needs to be converted back to electronVolts
+   noise /= res->GetSSDDEvToADC(1.);
+
+   // Finally, noise is added to the signal
+   signal = noise + fMapA2->GetSignal(0,ix);//get signal from map
+   fMapA2->SetHit(0,ix,signal); // give back signal to map
+   if(signal>0.0) pList->AddNoise(0,ix,module,noise);
+ } // loop over strip 
+
+   // Nside
+ for(ix=0;ix<GetNStrips();ix++){      // loop over strips
+   noise  = (Double_t) gRandom->Gaus(0,res->GetNoiseN(ix));// give noise to signal
+   noise *= (Double_t) res->GetGainN(ix); 
+   noise /= res->GetSSDDEvToADC(1.);
+   signal = noise + fMapA2->GetSignal(1,ix);//get signal from map
+   fMapA2->SetHit(1,ix,signal); // give back signal to map
+   if(signal>0.0) pList->AddNoise(1,ix,module,noise);
+ } // loop over strip 
+
 }
 //______________________________________________________________________
 void AliITSsimulationSSD::ApplyCoupling(AliITSpList *pList,Int_t module) {
 // Apply the effect of electronic coupling between channels
 Int_t ix;
 Double_t signal=0;
 //AliITSCalibrationSSD* res =(AliITSCalibrationSSD*)GetCalibrationModel(module);
 AliITSSimuParam* res = fDetType->GetSimuParam();
-    
 Double_t *contrLeft  = new Double_t[GetNStrips()];
 Double_t *contrRight = new Double_t[GetNStrips()];
-  
 // P side coupling
 for(ix=0;ix<GetNStrips();ix++){
-    if(ix>0) contrLeft[ix] = fMapA2->GetSignal(0,ix-1)*res->GetSSDCouplingPL();
-    else contrLeft[ix] = 0.0;
-    if(ix<(GetNStrips()-1)) contrRight[ix] = fMapA2->GetSignal(0,ix+1)*res->GetSSDCouplingPR();
-    else contrRight[ix] = 0.0;
 } // loop over strips 
-  
 for(ix=0;ix<GetNStrips();ix++){
-    signal = contrLeft[ix] + contrRight[ix] - res->GetSSDCouplingPL() * fMapA2->GetSignal(0,ix)
-      - res->GetSSDCouplingPR() * fMapA2->GetSignal(0,ix);
-    fMapA2->AddSignal(0,ix,signal);
-    if(signal>0.0) pList->AddNoise(0,ix,module,signal);
 } // loop over strips 
-  
 // N side coupling
 for(ix=0;ix<GetNStrips();ix++){
-    if(ix>0) contrLeft[ix] = fMapA2->GetSignal(1,ix-1)*res->GetSSDCouplingNL();
-    else contrLeft[ix] = 0.0;
-    if(ix<(GetNStrips()-1)) contrRight[ix] = fMapA2->GetSignal(1,ix+1)*res->GetSSDCouplingNR();
-    else contrRight[ix] = 0.0;
 } // loop over strips 
-  
 for(ix=0;ix<GetNStrips();ix++){
-    signal = contrLeft[ix] + contrRight[ix] - res->GetSSDCouplingNL() * fMapA2->GetSignal(0,ix)
-      - res->GetSSDCouplingNR() * fMapA2->GetSignal(0,ix);
-    fMapA2->AddSignal(1,ix,signal);
-    if(signal>0.0) pList->AddNoise(1,ix,module,signal);
 } // loop over strips 
-  
-
 delete [] contrLeft;
 delete [] contrRight; 
+ // Apply the effect of electronic coupling between channels
+ Int_t ix;
+ Double_t signal=0;
+ //AliITSCalibrationSSD* res =(AliITSCalibrationSSD*)GetCalibrationModel(module);
+ AliITSSimuParam* res = fDetType->GetSimuParam();
+
+ Double_t *contrLeft  = new Double_t[GetNStrips()];
+ Double_t *contrRight = new Double_t[GetNStrips()];
+
+ // P side coupling
+ for(ix=0;ix<GetNStrips();ix++){
+   if(ix>0) contrLeft[ix] = fMapA2->GetSignal(0,ix-1)*res->GetSSDCouplingPL();
+   else contrLeft[ix] = 0.0;
+   if(ix<(GetNStrips()-1)) contrRight[ix] = fMapA2->GetSignal(0,ix+1)*res->GetSSDCouplingPR();
+   else contrRight[ix] = 0.0;
+ } // loop over strips 
+
+ for(ix=0;ix<GetNStrips();ix++){
+   signal = contrLeft[ix] + contrRight[ix] - res->GetSSDCouplingPL() * fMapA2->GetSignal(0,ix)
+     - res->GetSSDCouplingPR() * fMapA2->GetSignal(0,ix);
+   fMapA2->AddSignal(0,ix,signal);
+   if(signal>0.0) pList->AddNoise(0,ix,module,signal);
+ } // loop over strips 
+
+ // N side coupling
+ for(ix=0;ix<GetNStrips();ix++){
+   if(ix>0) contrLeft[ix] = fMapA2->GetSignal(1,ix-1)*res->GetSSDCouplingNL();
+   else contrLeft[ix] = 0.0;
+   if(ix<(GetNStrips()-1)) contrRight[ix] = fMapA2->GetSignal(1,ix+1)*res->GetSSDCouplingNR();
+   else contrRight[ix] = 0.0;
+ } // loop over strips 
+
+ for(ix=0;ix<GetNStrips();ix++){
+   signal = contrLeft[ix] + contrRight[ix] - res->GetSSDCouplingNL() * fMapA2->GetSignal(0,ix)
+     - res->GetSSDCouplingNR() * fMapA2->GetSignal(0,ix);
+   fMapA2->AddSignal(1,ix,signal);
+   if(signal>0.0) pList->AddNoise(1,ix,module,signal);
+ } // loop over strips 
+
+
+ delete [] contrLeft;
+ delete [] contrRight; 
 }
 
 //______________________________________________________________________
 void AliITSsimulationSSD::ApplyDeadChannels(Int_t module) {
 // Kill dead channels setting gain to zero
+ // Kill dead channels setting gain to zero
 
 AliITSCalibrationSSD* res = (AliITSCalibrationSSD*)GetCalibrationModel(module);
+ AliITSCalibrationSSD* res = (AliITSCalibrationSSD*)GetCalibrationModel(module);
 
 for(Int_t i=0;i<GetNStrips();i++){
+ for(Int_t i=0;i<GetNStrips();i++){
 
-    if(res->IsPChannelBad(i)) res->SetGainP(i,0.0);
-    if(res->IsNChannelBad(i)) res->SetGainN(i,0.0);
+   if(res->IsPChannelBad(i)) res->SetGainP(i,0.0);
+   if(res->IsNChannelBad(i)) res->SetGainN(i,0.0);
 
 } // loop over strips 
+ } // loop over strips 
 
 }
 
 //______________________________________________________________________
 Float_t AliITSsimulationSSD::F(Float_t av, Float_t x, Float_t s) {
-    // Computes the integral of a gaussian using Error Function
-    Float_t sqrt2 = TMath::Sqrt(2.0);
-    Float_t sigm2 = sqrt2*s;
-    Float_t integral;
+   // Computes the integral of a gaussian using Error Function
+   Float_t sqrt2 = TMath::Sqrt(2.0);
+   Float_t sigm2 = sqrt2*s;
+   Float_t integral;
 
-    integral = 0.5 * TMath::Erf( (x - av) / sigm2);
-    return integral;
+   integral = 0.5 * TMath::Erf( (x - av) / sigm2);
+   return integral;
 }
 //______________________________________________________________________
 void AliITSsimulationSSD::IntegrateGaussian(Int_t k,Double_t par, Double_t w,
-                                            Double_t sigma, 
-                                            Double_t inf, Double_t sup,
-                                            AliITSTableSSD *tav) {
-    // integrate the diffusion gaussian
-    // remind: inf and sup are w-3sigma and w+3sigma
-    //         we could define them here instead of passing them
-    //         this way we are free to introduce asimmetry
-
-    Double_t a=0.0, b=0.0;
-    Double_t dXCharge1 = 0.0, dXCharge2 = 0.0;
-    // dXCharge1 and 2 are the charge to two neighbouring strips
-    // Watch that we only involve at least two strips
-    // Numbers greater than 2 of strips in a cluster depend on
-    //  geometry of the track and delta rays, not charge diffusion!   
-
-    Double_t strip = TMath::Floor(w);         // closest strip on the left
-
-    if ( TMath::Abs((strip - w)) < 0.5) { 
-        // gaussian mean is closer to strip on the left
-        a = inf;                         // integration starting point
-        if((strip+0.5)<=sup) {
-            // this means that the tail of the gaussian goes beyond
-            // the middle point between strips ---> part of the signal
-            // is given to the strip on the right
-            b = strip + 0.5;               // integration stopping point
-            dXCharge1 = F( w, b, sigma) - F(w, a, sigma);
-            dXCharge2 = F( w, sup, sigma) - F(w ,b, sigma); 
-        }else { 
-            // this means that all the charge is given to the strip on the left
-            b = sup;
-            dXCharge1 = 0.9973;   // gaussian integral at 3 sigmas
-            dXCharge2 = 0.0;
-        } // end if
-        dXCharge1 = par * dXCharge1;// normalize by mean of number of carriers
-        dXCharge2 = par * dXCharge2;
-
-        // for the time being, signal is the charge
-        // in ChargeToSignal signal is converted in ADC channel
-        fMapA2->AddSignal(k,(Int_t)strip,dXCharge1);
-        tav->Add(k,(Int_t)strip);
-        if(((Int_t) strip) < (GetNStrips()-1)) {
-            // strip doesn't have to be the last (remind: last=GetNStrips()-1)
-            // otherwise part of the charge is lost
-            fMapA2->AddSignal(k,((Int_t)strip+1),dXCharge2);
-            tav->Add(k,((Int_t)(strip+1)));
-        } // end if
-    }else{
-        // gaussian mean is closer to strip on the right
-        strip++;     // move to strip on the rigth
-        b = sup;     // now you know where to stop integrating
-        if((strip-0.5)>=inf) { 
-            // tail of diffusion gaussian on the left goes left of
-            // middle point between strips
-            a = strip - 0.5;        // integration starting point
-            dXCharge1 = F(w, b, sigma) - F(w, a, sigma);
-            dXCharge2 = F(w, a, sigma) - F(w, inf, sigma);
-        }else {
-            a = inf;
-            dXCharge1 = 0.9973;   // gaussian integral at 3 sigmas
-            dXCharge2 = 0.0;
-        } // end if
-        dXCharge1 = par * dXCharge1;    // normalize by means of carriers
-        dXCharge2 = par * dXCharge2;
-        // for the time being, signal is the charge
-        // in ChargeToSignal signal is converted in ADC channel
-        fMapA2->AddSignal(k,(Int_t)strip,dXCharge1);
-        tav->Add(k,(Int_t)strip);
-        if(((Int_t) strip) > 0) {
-            // strip doesn't have to be the first
-            // otherwise part of the charge is lost
-            fMapA2->AddSignal(k,((Int_t)strip-1),dXCharge2);
-            tav->Add(k,((Int_t)(strip-1)));
-        } // end if
-    } // end if
+                                           Double_t sigma, 
+                                           Double_t inf, Double_t sup,
+                                           AliITSTableSSD *tav) {
+   // integrate the diffusion gaussian
+   // remind: inf and sup are w-3sigma and w+3sigma
+   //         we could define them here instead of passing them
+   //         this way we are free to introduce asimmetry
+
+   Double_t a=0.0, b=0.0;
+   Double_t dXCharge1 = 0.0, dXCharge2 = 0.0;
+   // dXCharge1 and 2 are the charge to two neighbouring strips
+   // Watch that we only involve at least two strips
+   // Numbers greater than 2 of strips in a cluster depend on
+   //  geometry of the track and delta rays, not charge diffusion!   
+
+   Double_t strip = TMath::Floor(w);         // closest strip on the left
+
+   if ( TMath::Abs((strip - w)) < 0.5) { 
+       // gaussian mean is closer to strip on the left
+       a = inf;                         // integration starting point
+       if((strip+0.5)<=sup) {
+           // this means that the tail of the gaussian goes beyond
+           // the middle point between strips ---> part of the signal
+           // is given to the strip on the right
+           b = strip + 0.5;               // integration stopping point
+           dXCharge1 = F( w, b, sigma) - F(w, a, sigma);
+           dXCharge2 = F( w, sup, sigma) - F(w ,b, sigma); 
+       }else { 
+           // this means that all the charge is given to the strip on the left
+           b = sup;
+           dXCharge1 = 0.9973;   // gaussian integral at 3 sigmas
+           dXCharge2 = 0.0;
+       } // end if
+       dXCharge1 = par * dXCharge1;// normalize by mean of number of carriers
+       dXCharge2 = par * dXCharge2;
+
+       // for the time being, signal is the charge
+       // in ChargeToSignal signal is converted in ADC channel
+       fMapA2->AddSignal(k,(Int_t)strip,dXCharge1);
+       tav->Add(k,(Int_t)strip);
+       if(((Int_t) strip) < (GetNStrips()-1)) {
+           // strip doesn't have to be the last (remind: last=GetNStrips()-1)
+           // otherwise part of the charge is lost
+           fMapA2->AddSignal(k,((Int_t)strip+1),dXCharge2);
+           tav->Add(k,((Int_t)(strip+1)));
+       } // end if
+   }else{
+       // gaussian mean is closer to strip on the right
+       strip++;     // move to strip on the rigth
+       b = sup;     // now you know where to stop integrating
+       if((strip-0.5)>=inf) { 
+           // tail of diffusion gaussian on the left goes left of
+           // middle point between strips
+           a = strip - 0.5;        // integration starting point
+           dXCharge1 = F(w, b, sigma) - F(w, a, sigma);
+           dXCharge2 = F(w, a, sigma) - F(w, inf, sigma);
+       }else {
+           a = inf;
+           dXCharge1 = 0.9973;   // gaussian integral at 3 sigmas
+           dXCharge2 = 0.0;
+       } // end if
+       dXCharge1 = par * dXCharge1;    // normalize by means of carriers
+       dXCharge2 = par * dXCharge2;
+       // for the time being, signal is the charge
+       // in ChargeToSignal signal is converted in ADC channel
+       fMapA2->AddSignal(k,(Int_t)strip,dXCharge1);
+       tav->Add(k,(Int_t)strip);
+       if(((Int_t) strip) > 0) {
+           // strip doesn't have to be the first
+           // otherwise part of the charge is lost
+           fMapA2->AddSignal(k,((Int_t)strip-1),dXCharge2);
+           tav->Add(k,((Int_t)(strip-1)));
+       } // end if
+   } // end if
 }
 //______________________________________________________________________
 Int_t AliITSsimulationSSD::NumOfSteps(Double_t x, Double_t y, Double_t z,
-                                      Double_t &dex,Double_t &dey,
-                                      Double_t &dez){
-    // number of steps
-    // it also returns steps for each coord
-    //AliITSsegmentationSSD *seg = new AliITSsegmentationSSD();
-
-    Double_t step = 25E-4;
-    //step = (Double_t) seg->GetStepSize();  // step size (cm)
-    Int_t numOfSteps = (Int_t) (TMath::Sqrt(x*x+y*y+z*z)/step); 
-
-    if (numOfSteps < 1) numOfSteps = 1;       // one step, at least
-    //numOfSteps=1;
-
-    // we could condition the stepping depending on the incident angle
-    // of the track
-    dex = x/numOfSteps;
-    dey = y/numOfSteps;
-    dez = z/numOfSteps;
-    
-    return numOfSteps;
+                                     Double_t &dex,Double_t &dey,
+                                     Double_t &dez){
+   // number of steps
+   // it also returns steps for each coord
+   //AliITSsegmentationSSD *seg = new AliITSsegmentationSSD();
+
+   Double_t step = 25E-4;
+   //step = (Double_t) seg->GetStepSize();  // step size (cm)
+   Int_t numOfSteps = (Int_t) (TMath::Sqrt(x*x+y*y+z*z)/step); 
+
+   if (numOfSteps < 1) numOfSteps = 1;       // one step, at least
+   //numOfSteps=1;
+
+   // we could condition the stepping depending on the incident angle
+   // of the track
+   dex = x/numOfSteps;
+   dey = y/numOfSteps;
+   dez = z/numOfSteps;
+
+   return numOfSteps;
 }
 //----------------------------------------------------------------------
 void AliITSsimulationSSD::GetList(Int_t label,Int_t hit,Int_t mod,
-                                  AliITSpList *pList,AliITSTableSSD *tav) {
-    // loop over nonzero digits
-    Int_t ix,i;
-    Double_t signal=0.;
-
-    for(Int_t k=0; k<2; k++) {
-        ix=tav->Use(k);
-        while(ix>-1){
-            signal = fMapA2->GetSignal(k,ix);
-            if(signal==0.0) {
-                ix=tav->Use(k);
-                continue;
-            } // end if signal==0.0
-            // check the signal magnitude
-            for(i=0;i<pList->GetNSignals(k,ix);i++){
-                signal -= pList->GetTSignal(k,ix,i);
-            } // end for i
-            //  compare the new signal with already existing list
-            if(signal>0)pList->AddSignal(k,ix,label,hit,mod,signal);
-            ix=tav->Use(k);
-        } // end of loop on strips
-    } // end of loop on P/N side
-    tav->Clear();
+                                 AliITSpList *pList,AliITSTableSSD *tav) {
+   // loop over nonzero digits
+   Int_t ix,i;
+   Double_t signal=0.;
+
+   for(Int_t k=0; k<2; k++) {
+       ix=tav->Use(k);
+       while(ix>-1){
+           signal = fMapA2->GetSignal(k,ix);
+           if(signal==0.0) {
+               ix=tav->Use(k);
+               continue;
+           } // end if signal==0.0
+           // check the signal magnitude
+           for(i=0;i<pList->GetNSignals(k,ix);i++){
+               signal -= pList->GetTSignal(k,ix,i);
+           } // end for i
+           //  compare the new signal with already existing list
+           if(signal>0)pList->AddSignal(k,ix,label,hit,mod,signal);
+           ix=tav->Use(k);
+       } // end of loop on strips
+   } // end of loop on P/N side
+   tav->Clear();
 }
 //----------------------------------------------------------------------
 void AliITSsimulationSSD::ChargeToSignal(Int_t module,AliITSpList *pList) {
-    // charge to signal
-    static AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
-    Float_t threshold = 0.;
-    Int_t size = AliITSdigitSSD::GetNTracks();
-    Int_t * digits = new Int_t[size];
-    Int_t * tracks = new Int_t[size];
-    Int_t * hits = new Int_t[size];
-    Int_t j1;
-    Float_t charges[3] = {0.0,0.0,0.0};
-    Float_t signal;
-    AliITSCalibrationSSD* res =(AliITSCalibrationSSD*)GetCalibrationModel(module);
-    AliITSSimuParam* simpar = fDetType->GetSimuParam();
-
-    for(Int_t k=0;k<2;k++){         // both sides (0=Pside, 1=Nside)
-      for(Int_t ix=0;ix<GetNStrips();ix++){     // loop over strips
+   // charge to signal
+   static AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
+   Float_t threshold = 0.;
+   Int_t size = AliITSdigitSSD::GetNTracks();
+   Int_t * digits = new Int_t[size];
+   Int_t * tracks = new Int_t[size];
+   Int_t * hits = new Int_t[size];
+   Int_t j1;
+   Float_t charges[3] = {0.0,0.0,0.0};
+   Float_t signal;
+   AliITSCalibrationSSD* res =(AliITSCalibrationSSD*)GetCalibrationModel(module);
+   AliITSSimuParam* simpar = fDetType->GetSimuParam();
+
+   for(Int_t k=0;k<2;k++){         // both sides (0=Pside, 1=Nside)
+     for(Int_t ix=0;ix<GetNStrips();ix++){     // loop over strips
 
        // if strip is dead -> gain=0
        if( ((k==0)&&(res->GetGainP(ix)==0)) || ((k==1)&&(res->GetGainN(ix)==0))) continue;
@@ -683,75 +701,71 @@ void AliITSsimulationSSD::ChargeToSignal(Int_t module,AliITSpList *pList) {
        } // end for j1
        // finally add digit
        aliITS->AddSimDigit(2,0,digits,tracks,hits,charges);
-      } // end for ix
-    } // end for k
-    delete [] digits;
-    delete [] tracks;
-    delete [] hits;
+     } // end for ix
+   } // end for k
+   delete [] digits;
+   delete [] tracks;
+   delete [] hits;
 }
 //______________________________________________________________________
 void AliITSsimulationSSD::WriteSDigits(AliITSpList *pList){
-    // Fills the Summable digits Tree
-    Int_t i,ni,j,nj;
-    static AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
-
-    pList->GetMaxMapIndex(ni,nj);
-    for(i=0;i<ni;i++)for(j=0;j<nj;j++){
-        if(pList->GetSignalOnly(i,j)>0.0){
-            aliITS->AddSumDigit(*(pList->GetpListItem(i,j)));
-            if(GetDebug(4)) cout << "pListSSD: "<<*(pList->GetpListItem(i,j))
-                                << endl;
-        } // end if
-    } // end for i,j
 return;
+   // Fills the Summable digits Tree
+   Int_t i,ni,j,nj;
+   static AliITS *aliITS = (AliITS*)gAlice->GetModule("ITS");
+
+   pList->GetMaxMapIndex(ni,nj);
+   for(i=0;i<ni;i++)for(j=0;j<nj;j++){
+       if(pList->GetSignalOnly(i,j)>0.0){
+           aliITS->AddSumDigit(*(pList->GetpListItem(i,j)));
+           if(GetDebug(4)) cout << "pListSSD: "<<*(pList->GetpListItem(i,j))
+                               << endl;
+       } // end if
+   } // end for i,j
+ return;
 }
 //______________________________________________________________________
 void AliITSsimulationSSD::FillMapFrompList(AliITSpList *pList){
-    // Fills fMap2A from the pList of Summable digits
-    Int_t k,ix;
+   // Fills fMap2A from the pList of Summable digits
+   Int_t k,ix;
 
-    for(k=0;k<2;k++)for(ix=0;ix<GetNStrips();ix++) 
-        fMapA2->AddSignal(k,ix,pList->GetSignal(k,ix));
-    return;
+   for(k=0;k<2;k++)for(ix=0;ix<GetNStrips();ix++) 
+       fMapA2->AddSignal(k,ix,pList->GetSignal(k,ix));
+   return;
 }
 //______________________________________________________________________
 void AliITSsimulationSSD::Print(ostream *os){
-    //Standard output format for this class
-
-    //AliITSsimulation::Print(os);
-    *os << fIonE <<",";
-    *os << fDifConst[0] <<","<< fDifConst[1] <<",";
-    *os << fDriftVel[0] <<","<< fDriftVel[1];
-    //*os <<","; fDCS->Print(os);
-    //*os <<","; fMapA2->Print(os);
+   //Standard output format for this class
+
+   //AliITSsimulation::Print(os);
+   *os << fIonE <<",";
+   *os << fDifConst[0] <<","<< fDifConst[1] <<",";
+   *os << fDriftVel[0] <<","<< fDriftVel[1];
+   //*os <<","; fDCS->Print(os);
+   //*os <<","; fMapA2->Print(os);
 }
 //______________________________________________________________________
 void AliITSsimulationSSD::Read(istream *is){
-    // Standard output streaming function.
-
-    //AliITSsimulation::Read(is);
-    *is >> fIonE;
-    *is >> fDifConst[0] >> fDifConst[1];
-    *is >> fDriftVel[0] >> fDriftVel[1];
-    //fDCS->Read(is);
-    //fMapA2->Read(is);
+   // Standard output streaming function.
+
+   //AliITSsimulation::Read(is);
+   *is >> fIonE;
+   *is >> fDifConst[0] >> fDifConst[1];
+   *is >> fDriftVel[0] >> fDriftVel[1];
+   //fDCS->Read(is);
+   //fMapA2->Read(is);
 }
 //______________________________________________________________________
 ostream &operator<<(ostream &os,AliITSsimulationSSD &source){
-    // Standard output streaming function.
+   // Standard output streaming function.
 
-    source.Print(&os);
-    return os;
+   source.Print(&os);
+   return os;
 }
 //______________________________________________________________________
 istream &operator>>(istream &os,AliITSsimulationSSD &source){
-    // Standard output streaming function.
+   // Standard output streaming function.
 
-    source.Read(&os);
-    return os;
+   source.Read(&os);
+   return os;
 }
 //______________________________________________________________________
-
-
-
-
index b2ec98ff016ad21fe72949bc2d9f69a0f03c4d69..84be98aa0ea98c260aaf545798fea38f3bf6fe1b 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef ALIITSSIMULATIONSSD_H
 #define ALIITSSIMULATIONSSD_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice     */
+* See cxx source for full Copyright notice     */
 
 /* $Id$ */
 
@@ -18,114 +18,117 @@ class AliITSTableSSD;
 //class AliITSdcsSSD;
 class AliITSsegmentationSSD;
 class AliITSCalibrationSSD;
+class TF1;
 
 class AliITSsimulationSSD: public AliITSsimulation {
 
- public:
-    AliITSsimulationSSD(); // Default constructor
-    AliITSsimulationSSD(const AliITSsimulationSSD &source); // copy constructor
-    // operator =
-    AliITSsimulationSSD& operator=(const AliITSsimulationSSD &source);
-    //    virtual AliITSsimulation& operator=(const AliITSsimulation &source);
-    //Standard Constructor
-    AliITSsimulationSSD(AliITSDetTypeSim* dettyp);
-    //Destructor
-    virtual ~AliITSsimulationSSD();
-    // Get a pointer to the segmentation object
-    virtual AliITSsegmentation* GetSegmentationModel(Int_t /*dt*/){return fDetType->GetSegmentationModel(2);}
-    // set pointer to segmentation objec
-    virtual void SetSegmentationModel(Int_t /*dt*/, AliITSsegmentation *seg){fDetType->SetSegmentationModel(2,seg);}
-    // Initilize variables for this simulation
-    void Init();
-    // Initilize variables for this simulation
-    //void Init(AliITSsegmentationSSD *seg,AliITSCalibrationSSD *resp);
-    // Create maps to build the lists of tracks for each summable digit
-    void InitSimulationModule(Int_t module,Int_t events);
-    // Digitize module from the sum of summable digits.
-    void FinishSDigitiseModule();
-    //Digitizes all of the hits in a module
-    void DigitiseModule(AliITSmodule *mod,Int_t dummy0,Int_t dummy1);
-    // Computes the Summable Digits
-    void SDigitiseModule(AliITSmodule *mod,Int_t module,Int_t dummy);
-    // Computes the Charge on each Strip/ Analog/summable digits
-    void HitsToAnalogDigits(AliITSmodule *mod,AliITSpList *pList);
-    //Computes the signal from one hit
-    void HitToDigit(Int_t module,Double_t x0,Double_t y0,Double_t z0, 
+public:
+   AliITSsimulationSSD(); // Default constructor
+   AliITSsimulationSSD(const AliITSsimulationSSD &source); // copy constructor
+   // operator =
+   AliITSsimulationSSD& operator=(const AliITSsimulationSSD &source);
+   //    virtual AliITSsimulation& operator=(const AliITSsimulation &source);
+   //Standard Constructor
+   AliITSsimulationSSD(AliITSDetTypeSim* dettyp);
+   //Destructor
+   virtual ~AliITSsimulationSSD();
+   // Get a pointer to the segmentation object
+   virtual AliITSsegmentation* GetSegmentationModel(Int_t /*dt*/){return fDetType->GetSegmentationModel(2);}
+   // set pointer to segmentation objec
+   virtual void SetSegmentationModel(Int_t /*dt*/, AliITSsegmentation *seg){fDetType->SetSegmentationModel(2,seg);}
+   // Initilize variables for this simulation
+   void Init();
+   // Initilize variables for this simulation
+   //void Init(AliITSsegmentationSSD *seg,AliITSCalibrationSSD *resp);
+   // Create maps to build the lists of tracks for each summable digit
+   void InitSimulationModule(Int_t module,Int_t events);
+   // Digitize module from the sum of summable digits.
+   void FinishSDigitiseModule();
+   //Digitizes all of the hits in a module
+   void DigitiseModule(AliITSmodule *mod,Int_t dummy0,Int_t dummy1);
+   // Computes the Summable Digits
+   void SDigitiseModule(AliITSmodule *mod,Int_t module,Int_t dummy);
+   // Computes the Charge on each Strip/ Analog/summable digits
+   void HitsToAnalogDigits(AliITSmodule *mod,AliITSpList *pList);
+   //Computes the signal from one hit
+   void HitToDigit(Int_t module,Double_t x0,Double_t y0,Double_t z0, 
                    Double_t x,Double_t y,Double_t z,Double_t de,
                    AliITSTableSSD *tav);
-    //returns a pointer to the SSD segmentation.
-    /*AliITSsegmentationSSD *GetSegmentation() {
+   //returns a pointer to the SSD segmentation.
+   /*AliITSsegmentationSSD *GetSegmentation() {
        return (AliITSsegmentationSSD*) fSegmentation;}
-    */
-    //Returns the ionization energy for Si in GeV.
-    Double_t GetIonizeE() const {return fIonE;}
-    //Sets the ionization energy for Si in GeV.
-    void SetIonizeE(Double_t e=3.62E-09){fIonE = e;}
-    //Returns the Diffusion constant h in cm**2/sec
-    Double_t GetDiffConst(Int_t i) const {return fDifConst[i];}
-    //Sets the Diffusion constant h in cm**2/sec
-    void SetDiffConst(Double_t h=11.0,Double_t e=30.0)
+   */
+   //Returns the ionization energy for Si in GeV.
+   Double_t GetIonizeE() const {return fIonE;}
+   //Sets the ionization energy for Si in GeV.
+   void SetIonizeE(Double_t e=3.62E-09){fIonE = e;}
+   //Returns the Diffusion constant h in cm**2/sec
+   Double_t GetDiffConst(Int_t i) const {return fDifConst[i];}
+   //Sets the Diffusion constant h in cm**2/sec
+   void SetDiffConst(Double_t h=11.0,Double_t e=30.0)
        {fDifConst[0] = h;fDifConst[1]=e;}
-    //Returns the Drift velocity for the side i
-    Double_t GetDriftVelocity(Int_t i) const {return fDriftVel[i];}
-    //Sets the Drift velocity for the P and N sides
-    void SetDriftVelocity(Double_t v0=0.86E+06,Double_t v1=2.28E+06)
+   //Returns the Drift velocity for the side i
+   Double_t GetDriftVelocity(Int_t i) const {return fDriftVel[i];}
+   //Sets the Drift velocity for the P and N sides
+   void SetDriftVelocity(Double_t v0=0.86E+06,Double_t v1=2.28E+06)
        {fDriftVel[0] = v0;fDriftVel[1] = v1;}
-    // Standard ascii class print function
-    void Print(ostream *os);
-    // Standard ascii class read function
-    void Read(istream *is);
-    virtual void Print(Option_t *option="") const {TObject::Print(option);}
-    virtual Int_t Read(const char *name) {return TObject::Read(name);}
-    // Data members
- protected:
+   // Standard ascii class print function
+   void Print(ostream *os);
+   // Standard ascii class read function
+   void Read(istream *is);
+   virtual void Print(Option_t *option="") const {TObject::Print(option);}
+   virtual Int_t Read(const char *name) {return TObject::Read(name);}
+   // Data members
+protected:
 
-    //    AliITSdcsSSD *fDCS;   // Class containing detector controle paramters
+   //    AliITSdcsSSD *fDCS;   // Class containing detector controle paramters
 
- private:
-    // Return the Response class
-    //    AliITSCalibrationSSD* GetResp(){return (AliITSCalibrationSSD*)fResponse;}
-    // Return the Segmentation class
-    //AliITSsegmentationSSD* GetSeg(){
-    //  return (AliITSsegmentationSSD*)fSegmentation;}
-    // returns the number of steps needed to proplerly distribute the charge
-    // in a step
-    Int_t NumOfSteps(Double_t x,Double_t y,Double_t z,
+private:
+   // Return the Response class
+   //    AliITSCalibrationSSD* GetResp(){return (AliITSCalibrationSSD*)fResponse;}
+   // Return the Segmentation class
+   //AliITSsegmentationSSD* GetSeg(){
+   //  return (AliITSsegmentationSSD*)fSegmentation;}
+   // returns the number of steps needed to proplerly distribute the charge
+   // in a step
+   Int_t NumOfSteps(Double_t x,Double_t y,Double_t z,
                     Double_t  &dex,Double_t &dey,Double_t &dez);
-    // Keepts track and orders tracks for a give strip.
-    void GetList(Int_t trk,Int_t ht,Int_t mod,AliITSpList *pLt,
+   // Keepts track and orders tracks for a give strip.
+   void GetList(Int_t trk,Int_t ht,Int_t mod,AliITSpList *pLt,
                 AliITSTableSSD *tav);
-    // sets thresholds and fills digits
-    void ChargeToSignal(Int_t module,AliITSpList *pList);
-    // Writes Summable Digits to a root file for later use.
-    void WriteSDigits(AliITSpList *pList);
-    // ReadSDigits and create Digits
-    void SDigitToDigit(Int_t module,AliITSpList *pList);
-    // Fills fMapA2 from pList AliITSpList
-    void FillMapFrompList(AliITSpList *pList);
-    // Diffuses the charge onto neighboring strips.
-    void    IntegrateGaussian(Int_t k,Double_t par,Double_t av,Double_t sigma, 
+   // sets thresholds and fills digits
+   void ChargeToSignal(Int_t module,AliITSpList *pList);
+   // Writes Summable Digits to a root file for later use.
+   void WriteSDigits(AliITSpList *pList);
+   // ReadSDigits and create Digits
+   void SDigitToDigit(Int_t module,AliITSpList *pList);
+   // Fills fMapA2 from pList AliITSpList
+   void FillMapFrompList(AliITSpList *pList);
+   // Diffuses the charge onto neighboring strips.
+   void    IntegrateGaussian(Int_t k,Double_t par,Double_t av,Double_t sigma, 
                              Double_t inf, Double_t sup,
                              AliITSTableSSD *tav);
-     // Applies noise to strips randomly
-    void    ApplyNoise(AliITSpList *pList,Int_t mod);
-     // Applies posible signal coupling between strips
-    void    ApplyCoupling(AliITSpList *pList,Int_t mod);
-    // Kill dead channels
-    void ApplyDeadChannels(Int_t mod);
-    // Computes the integral of a gaussian using Error Function
-    Float_t F(Float_t av, Float_t x, Float_t s);
-    // returns, from the segmentation, the number of stips
-    Int_t GetNStrips() {AliITSsegmentationSSD* seg = (AliITSsegmentationSSD*)GetSegmentationModel(2);return seg->Npx();}
-    // returns, from the segmentation, the strip pitch
-    Float_t GetStripPitch() {AliITSsegmentationSSD* seg = (AliITSsegmentationSSD*)GetSegmentationModel(2);return seg->Dpx(0);}
+    // Applies noise to strips randomly
+   void    ApplyNoise(AliITSpList *pList,Int_t mod);
+    // Applies posible signal coupling between strips
+   void    ApplyCoupling(AliITSpList *pList,Int_t mod);
+   // Kill dead channels
+   void ApplyDeadChannels(Int_t mod);
+   // Computes the integral of a gaussian using Error Function
+   Float_t F(Float_t av, Float_t x, Float_t s);
+   // returns, from the segmentation, the number of stips
+   Int_t GetNStrips() {AliITSsegmentationSSD* seg = (AliITSsegmentationSSD*)GetSegmentationModel(2);return seg->Npx();}
+   // returns, from the segmentation, the strip pitch
+   Float_t GetStripPitch() {AliITSsegmentationSSD* seg = (AliITSsegmentationSSD*)GetSegmentationModel(2);return seg->Dpx(0);}
 
-    AliITSMapA2 *fMapA2;      //! Map of ionization, used localy only
-    Double_t    fIonE;        // ionization energy of Si in GeV
-    Double_t    fDifConst[2]; // Diffusion constants [h,e] in cm**2/sec
-    Double_t    fDriftVel[2]; // Drift velocities [P,N sides] cm/sec
+   AliITSMapA2 *fMapA2;      //! Map of ionization, used localy only
+   Double_t    fIonE;        // ionization energy of Si in GeV
+   Double_t    fDifConst[2]; // Diffusion constants [h,e] in cm**2/sec
+   Double_t    fDriftVel[2]; // Drift velocities [P,N sides] cm/sec
 
-    ClassDef(AliITSsimulationSSD,2) // SSD signal simulation class
+   TF1         *fTimeResponse; // signal time response function
+
+   ClassDef(AliITSsimulationSSD,2) // SSD signal simulation class
 
 };
 // Input and output functions for standard C++ input/output.
diff --git a/PWG2/EBYE/LRC/AliAnalysisTaskLRC.cxx b/PWG2/EBYE/LRC/AliAnalysisTaskLRC.cxx
new file mode 100644 (file)
index 0000000..75b32c0
--- /dev/null
@@ -0,0 +1,309 @@
+// Analysis task for Long Range Correlation (LRC) analysis using TPC data
+// This task is creatig TH2D histogramms for Nch - Nch , Nch - Pt , Pt - Pt 
+// dirtributions for given ETA windows and some supplementary data.  
+
+// Author : Andrey Ivanov , St.Peterburg State University
+// Email: Andrey.Ivanov@cern.ch
+
+// Version line : 3.0
+// Version: 3.0.8  may 08
+
+
+#include "TChain.h"
+#include "TTree.h"
+#include "TH1F.h"
+#include "TCanvas.h"
+#include "TH2D.h"
+#include "TProfile.h"
+#include "TList.h"
+
+#include "AliAnalysisTask.h"
+#include "AliAnalysisManager.h"
+
+#include "AliESDEvent.h"
+#include "AliESDInputHandler.h"
+
+#include "AliAnalysisTaskLRC.h"
+
+
+
+ClassImp(AliAnalysisTaskLRC)
+
+//________________________________________________________________________
+AliAnalysisTaskLRC::AliAnalysisTaskLRC(const char *name) 
+  : AliAnalysisTask(name, ""), fESD(0), fHistPt(0),fHistEta(0),fOutList(0),fHistNN(0),fHistPtN(0),fHistPtPt(0),fHistNberr(0),fProfdPtB(0),fProfTestLRC(0),fHistPtForward(0),fHistEtaForward(0),fHistNchForward(0),fHistPtBakward(0),fHistEtaBakward(0),fHistNchBakward(0)
+{
+  //Init
+  
+  // Constructor
+
+  SetETAWindows(-1.0,1.0,-1.0,1.0);   //Default windows (full range)
+  
+  // Define input and output slots here
+  // Input slot #0 works with a TChain
+  DefineInput(0, TChain::Class());
+  // Output slot #0 writes into a TList container for all histogramms
+  DefineOutput(0, TList::Class());
+  
+}
+
+
+// ---------------------------------------  Setters ------------------
+
+  void AliAnalysisTaskLRC::SetForwardWindow(double StartETA,double EndETA)
+  {
+  fStartForwardETA=StartETA;
+  fEndForwardETA=EndETA;
+  }
+  void AliAnalysisTaskLRC::SetBackwardWindow(double StartETA,double EndETA)
+  {
+  fStartBakwardETA=StartETA;
+  fEndBakwardETA=EndETA;
+  }
+  void AliAnalysisTaskLRC::SetETAWindows(double _StartForwardETA,double _EndForwardETA,double _StartBakwardETA,double _EndBakwardETA)
+  {
+  fStartForwardETA=_StartForwardETA;
+  fEndForwardETA=_EndForwardETA;
+  fStartBakwardETA=_StartBakwardETA;
+  fEndBakwardETA=_EndBakwardETA;
+  }
+
+
+
+//________________________________________________________________________
+void AliAnalysisTaskLRC::ConnectInputData(Option_t *) 
+{
+  // Connect ESD or AOD here
+  // Called once
+
+  TTree* tree = dynamic_cast<TTree*> (GetInputData(0));
+  if (!tree) {
+    Printf("ERROR: Could not read chain from input slot 0");
+  } else {
+    AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());
+
+    if (!esdH) {
+      Printf("ERROR: Could not get ESDInputHandler");
+    } else
+      fESD = esdH->GetEvent();
+  }
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskLRC::CreateOutputObjects()
+{
+  // Create histograms
+  
+
+   // Window statistics histograms
+  
+   // Forward
+  
+  fHistPtForward = new TH1D("fHistPtForward", "P_{T} distribution in Forward window", 150, 0.1, 3.1);
+  fHistPtForward->GetXaxis()->SetTitle("P_{T} (GeV/c)");
+  fHistPtForward->GetYaxis()->SetTitle("dN/dP_{T} (c/GeV)");
+  fHistPtForward->SetMarkerStyle(kFullCircle);
+  
+  
+  fHistEtaForward = new TH1D("fEtaForward", "#eta distribution in Forward window", 200, -2, 2);
+  fHistEtaForward->GetXaxis()->SetTitle("ETA");
+  fHistEtaForward->GetYaxis()->SetTitle("dN/ETA");
+  fHistEtaForward->SetMarkerStyle(kFullCircle);
+  
+  
+  fHistNchForward = new TH1D("fHistNchForward", "N_{ch} distribution in Forward window", 201, -0.5, 200.5);
+  fHistNchForward->GetXaxis()->SetTitle("N_{ch}");
+  fHistNchForward->GetYaxis()->SetTitle("dN/dN_{ch}");
+  fHistNchForward->SetMarkerStyle(kFullCircle);
+     // Bakward
+  
+  fHistPtBakward = new TH1D("fHistPtBakward", "P_{T} distribution in Bakward window", 150, 0.1, 3.1);
+  fHistPtBakward->GetXaxis()->SetTitle("P_{T} (GeV/c)");
+  fHistPtBakward->GetYaxis()->SetTitle("dN/dP_{T} (c/GeV)");
+  fHistPtBakward->SetMarkerStyle(kFullCircle);
+  
+  
+  fHistEtaBakward = new TH1D("fEtaBakward", "#eta distribution in Bakward window", 200, -2, 2);
+  fHistEtaBakward->GetXaxis()->SetTitle("ETA");
+  fHistEtaBakward->GetYaxis()->SetTitle("dN/ETA");
+  fHistEtaBakward->SetMarkerStyle(kFullCircle);
+  
+  
+  fHistNchBakward = new TH1D("fHistNchBakward", "N_{ch} distribution in Bakward window", 201, -0.5, 200.5);
+  fHistNchBakward->GetXaxis()->SetTitle("P_{T} (GeV/c)");
+  fHistNchBakward->GetYaxis()->SetTitle("dN/dP_{T} (c/GeV)");
+  fHistNchBakward->SetMarkerStyle(kFullCircle);
+
+  
+    // --------- Output list
+  
+  fOutList = new TList();
+   
+  //Overal statistics histograms
+  
+  fHistPt = new TH1F("fHistPt", "P_{T} distribution", 150, 0.1, 3.1);
+  fHistPt->GetXaxis()->SetTitle("P_{T} (GeV/c)");
+  fHistPt->GetYaxis()->SetTitle("dN/dP_{T} (c/GeV)");
+  fHistPt->SetMarkerStyle(kFullCircle);
+  
+  
+  fHistEta = new TH1F("fEta", "#eta distribution", 200, -2, 2);
+  fHistEta->GetXaxis()->SetTitle("ETA");
+  fHistEta->GetYaxis()->SetTitle("dN/ETA");
+  fHistEta->SetMarkerStyle(kFullCircle);
+    
+    
+    
+    // -------- LRC histograms
+  
+  fHistNN = new TH2D("NN","NN",100,0.5,100.5,100,0.5,100.5);//1000 ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ ï¿½ ï¿½ï¿½ï¿½ï¿½ ï¿½ï¿½ ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ 
+  fHistPtN = new TH2D("PtN","PtN",100,0.5,100.5,40,0,4);//4 gev - ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½
+  fHistPtPt = new TH2D("PtPt","PtPt",40,0,4,40,0,4);//4 gev - ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½
+  fHistNberr = new TH2D("nber","nber",100,0.5,100.5,1000,0,1);//��� ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ ï¿½ï¿½ï¿½ x ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ï¿½ ï¿½ Nf
+  fProfdPtB = new TProfile("dPtB","Overal multievent Pt_Backward (first bin) Pt_Backward^2 (sec. bin) ",2,0.5,2.5);  
+  fProfTestLRC = new TProfile("TestLRC","Test LRC calculaion via TProfile",100,0.5,100.5);  
+
+  
+  // ---------- Adding data members to output list
+  
+  // Adding overal statistics
+  
+  fOutList->Add(fHistPt);
+  fOutList->Add(fHistEta);
+  
+  //Adding LRC hists
+  
+  fOutList->Add(fHistNN);
+  fOutList->Add(fHistPtN);
+  fOutList->Add(fHistPtPt);
+  fOutList->Add(fHistNberr);
+  fOutList->Add(fProfdPtB);
+  fOutList->Add(fProfTestLRC);
+
+  
+  //Adding window statistics
+
+  fOutList->Add(fHistPtForward);
+  fOutList->Add(fHistEtaForward);
+  fOutList->Add(fHistNchForward);
+  fOutList->Add(fHistPtBakward);
+  fOutList->Add(fHistEtaBakward);
+  fOutList->Add(fHistNchBakward);
+  
+  
+  
+}
+
+//________________________________________________________________________
+void AliAnalysisTaskLRC::Exec(Option_t *) 
+{
+  // Main loop
+  // Called for each event
+
+  if (!fESD) {
+    Printf("ERROR: fESD not available");
+    return;
+  }
+
+  
+
+   //Event variables
+  double lPtF=0;   //Forward window Pt
+  double lPtB=0;   //Bakward window Pt
+  
+  int lNF=0;  // Forward multiplicity
+  int lNB=0;  // Bakward multiplicity
+  
+  
+  //Track variables
+  double lPt;   // Temp Pt
+  double lEta;   // Temp ETA   
+  
+    // Track loop 
+  for (Int_t iTracks = 0; iTracks < fESD->GetNumberOfTracks(); iTracks++) {
+    AliESDtrack* track = fESD->GetTrack(iTracks);
+    if (!track) {
+      Printf("ERROR: Could not receive track %d", iTracks);
+      continue;
+    }
+
+    
+    lPt=track->Pt();
+    lEta=track->Eta();
+    
+    //  Glabal trak data
+    fHistPt->Fill(lPt);
+    fHistEta->Fill(lEta);
+    
+    //Forward window
+    if( (fStartForwardETA<lEta)&&(lEta<fEndForwardETA))
+       {
+       lNF++;
+       lPtF+=lPt;
+       fHistPtForward->Fill(lPt);
+       fHistEtaForward->Fill(lEta);
+       
+       }
+    
+    //Backward window
+    if((fStartBakwardETA<lEta)&&(lEta<fEndBakwardETA))
+       {
+       lNB++;
+       lPtB+=lPt; 
+       if(lPt<4.0)
+       {
+       fProfdPtB->Fill(1,lPt); 
+       fProfdPtB->Fill(2,lPt*lPt);
+       }
+        
+       fHistPtBakward->Fill(lPt);
+       fHistEtaBakward->Fill(lEta);
+       }
+    
+    
+    
+    
+  } //end of track loop 
+  
+  
+  //Filling even-total data
+  fHistNN->Fill(lNF,lNB);
+  
+  if(lNB!=0)
+  {
+       lPtB=lPtB/lNB;
+       fProfTestLRC->Fill(lNF,lPtB);
+       fHistPtN->Fill(lNF,lPtB);
+       fHistNberr->Fill(lNF,1.0/lNB);
+       
+       if(lNF!=0)
+       {
+               lPtF=lPtF/lNF;
+               fHistPtPt->Fill(lPtF,lPtB);
+       }
+  }
+       
+  
+ fHistNchForward->Fill(lNF);
+ fHistNchBakward->Fill(lNB);
+  // Post output data.
+  
+  PostData(0, fOutList);
+}      
+
+//________________________________________________________________________
+void AliAnalysisTaskLRC::Terminate(Option_t *) 
+{
+  // Draw result to the screen
+  // Called once at the end of the query
+fOutList = dynamic_cast<TList*> (GetOutputData(0));
+
+  
+  
+}
diff --git a/PWG2/EBYE/LRC/AliAnalysisTaskLRC.h b/PWG2/EBYE/LRC/AliAnalysisTaskLRC.h
new file mode 100644 (file)
index 0000000..1fcc280
--- /dev/null
@@ -0,0 +1,96 @@
+#ifndef AliAnalysisTaskLRC_cxx\r
+#define AliAnalysisTaskLRC_cxx\r
+\r
+\r
+// Analysis task for Long Range Correlation (LRC) analysis using TPC data\r
+// This task is creatig TH2D histogramms for Nch - Nch , Nch - Pt , Pt - Pt \r
+// dirtributions for given ETA windows and some supplementary data.  \r
+\r
+// Author : Andrey Ivanov , St.Peterburg State University\r
+// Email: Andrey.Ivanov@cern.ch\r
+\r
+// Version line : 3.0\r
+// Version: 3.0.8  may 08\r
+\r
+\r
+class TH1F;\r
+class AliESDEvent;\r
+class TH2D;\r
+class TProfile;\r
+class TList;\r
+#include "AliAnalysisTask.h"\r
+\r
+class AliAnalysisTaskLRC : public AliAnalysisTask {\r
+\r
+public:\r
\r
\r
+  //Constructors\r
+  \r
+  AliAnalysisTaskLRC(const char *name = "AliAnalysisTaskLRC");\r
+  virtual ~AliAnalysisTaskLRC() {}\r
+  \r
+  //AliAnalysisTask overloading\r
+  virtual void   ConnectInputData(Option_t *);\r
+  virtual void   CreateOutputObjects();\r
+  virtual void   Exec(Option_t *option);\r
+  virtual void   Terminate(Option_t *);\r
+  \r
+  // Setters \r
+  void SetForwardWindow(double StartETA,double EndETA);\r
+  void SetBackwardWindow(double StartETA,double EndETA);\r
+  void SetETAWindows(double _StartForwardETA,double _EndForwardETA,double _StartBakwardETA,double _EndBakwardETA);\r
+  \r
+  \r
+  \r
+  \r
+private:\r
\r
+  AliESDEvent *fESD;    //ESD object\r
+  \r
+  // Total spectras (debugging)\r
+  TH1F        *fHistPt; //Overal Pt spectrum\r
+  TH1F        *fHistEta; //Overal Eta spectrum\r
+  \r
+ // Windows paramiters -----------------------------------\r
+  \r
+  double fStartForwardETA;  // Forward windos lover rapidity\r
+  double fEndForwardETA;    // Forward window higer rapidity   \r
+  double fStartBakwardETA;  // Bakward window lover rapidity\r
+  double fEndBakwardETA;    // Bakward window higer rapidity\r
+\r
\r
\r
+ //Otput List --------------------------------------------\r
+  \r
+  TList* fOutList;         // Output data container \r
\r
+ // Output histogramms -----------------------------------\r
+\r
+  TH2D* fHistNN;        // N-N 2D Profile\r
+  TH2D* fHistPtN;      // Pt-N 2D Profile\r
+  TH2D* fHistPtPt;     // Pt-Pt 2D Profile\r
+  TH2D* fHistNberr;    // Nbackward error Profile\r
+  TProfile* fProfdPtB;  // Used to store (in first bin) summary of PtB and its std diviation\r
+  TProfile* fProfTestLRC; // Diognostic LRC Pt - N correlation\r
+\r
+  // Supp. info for windows\r
+  //Forward\r
+  TH1D* fHistPtForward;   //Pt spectrum in Forward windows\r
+  TH1D* fHistEtaForward;  //Eta spectrum in Forward windows\r
+  TH1D* fHistNchForward;  //Nch spectrum in Forward windows\r
+  \r
+   //Bakward\r
+  TH1D* fHistPtBakward;   //Pt spectrum in Bakward windows\r
+  TH1D* fHistEtaBakward;  //Eta spectrum in Bakward windows\r
+  TH1D* fHistNchBakward;  //Nch spectrum in Bakward windows\r
\r
+  \r
+   \r
+  AliAnalysisTaskLRC(const AliAnalysisTaskLRC&); // not implemented\r
+  AliAnalysisTaskLRC& operator=(const AliAnalysisTaskLRC&); // not implemented\r
+  \r
+  ClassDef(AliAnalysisTaskLRC, 1); \r
+};\r
+\r
+#endif\r
diff --git a/PWG2/EBYE/macros/runLRCAnalysis.C b/PWG2/EBYE/macros/runLRCAnalysis.C
new file mode 100644 (file)
index 0000000..8035d91
--- /dev/null
@@ -0,0 +1,219 @@
+void runLRCAnalysis(const char* mode = "Local", 
+                   const char* inputName= "ESDs.lst") {
+// This macro runs AliAnalysisTaskLRC in three modes : "Local" , "Interactive", "PROOF", "GRID" 
+// ESD-only
+// inputName refers to :
+// "Local" - file with plane-text list of filenames 
+// "Intaractive","GRID" - XML collection name
+// "PROOF" - dataset name 
+//  
+//
+
+if(mode!="Local" && mode!="Interactive" && mode!="PROOF" && mode!="GRID")
+{
+cout<<" ! Mode must be : Local , Interactive, PROOF, GRID \n";
+cout<<" ! Unknown mode :"<<mode<< " \n";
+return;
+}
+
+if(mode=="Local")runLRCLocal(inputName);
+if(mode=="PROOF")runLRCProof(inputName);
+if(mode=="Interactive")runLRCInteractive(inputName);
+if(mode=="GRID")runLRCInteractive(inputName);
+
+
+}
+
+void runLRCLocal(const char* inputName= "ESDs.lst") {
+  printf("  ------------------------------------------\n");
+  printf("  # LRC local run manager \n");
+  cout<<"  # Task from :"<<gSystem->pwd()<<"\n";
+  cout<<"  # Input list :"<<inputName<<"\n";
+  cout<<"  # Loadnig libs...\n";
+  
+  TStopwatch timer;
+  timer.Start();
+  gSystem->Load("libTree.so");
+  gSystem->Load("libGeom.so");
+  gSystem->Load("libVMC.so");
+  gSystem->Load("libPhysics.so");
+  gSystem->Load("libSTEERBase.so");
+  gSystem->Load("libESD.so");
+  gSystem->Load("libAOD.so");
+  gSystem->Load("libANALYSIS.so");
+  gSystem->Load("libANALYSISalice.so");
+  gSystem->Load("libPWG2ebye.so");
+  
+  
+  //___________Compile analysis task using AClic____________//
+  gROOT->ProcessLine(".include $ALICE_ROOT/include");
+  cout<<"  # Compiling analysis task\n";
+  gROOT->LoadMacro("AliAnalysisTaskLRC.cxx+g");
+  gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C");
+
+  TChain* chain = CreateESDChain(inputName);
+  
+  //____________________________________________//
+  // Make the analysis manager
+  AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
+  AliESDInputHandler* esdH = new AliESDInputHandler();
+  mgr->SetInputEventHandler(esdH);  
+  
+  
+  AliAnalysisTaskLRC *task1 = new AliAnalysisTaskLRC("TaskLRC");
+  mgr->AddTask(task1);
+  
+  task1->SetETAWindows(-0.7,0.0,0.3,1.0);
+  
+  // Create containers for input/output
+  AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer);
+  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("chist1", TList::Class(),AliAnalysisManager::kOutputContainer,"LRC.ESD.testLocal.root");
+  
+  //____________________________________________//
+  mgr->ConnectInput(task1,0,cinput1);
+  mgr->ConnectOutput(task1,0,coutput1);
+  if (!mgr->InitAnalysis()) return;
+  mgr->PrintStatus();
+  mgr->StartAnalysis("local",chain);
+
+  timer.Stop();
+  timer.Print();
+}
+
+void runLRCProof(const char* inputName= "/COMMON/COMMON/tutorial_small")
+{
+  printf("  ------------------------------------------\n");
+  printf(" # LRC PROOF run manager \n");
+  cout<<"  # Task from :"<<gSystem->pwd()<<"\n";
+  cout<<"  # Dataset :"<<inputName<<"\n";
+
+
+       TProof::Open("alicecaf");
+       //TProof::Open("anivanov@localhost");
+
+       
+  cout<<"  # Loadnig libs...\n";
+               
+       gProof->UploadPackage("AF-v4-16");
+       gProof->EnablePackage("AF-v4-16");
+
+         
+  
+  // Use AliRoot includes to compile our task
+  gROOT->ProcessLine(".include $ALICE_ROOT/include");
+
+  cout<<"  # Compiling analysis task\n";
+  
+  
+  gProof->Load("AliAnalysisTaskLRC.cxx++g");   
+  task = new AliAnalysisTaskLRC("TestLRC");
+  
+  task->SetETAWindows(-0.7,0.0,0.3,1.0);
+
+    // Create the analysis manager
+  mgr = new AliAnalysisManager("testAnalysis");
+  
+  
+  mgr->AddTask(task);
+
+  AliESDInputHandler* esdH = new AliESDInputHandler();
+  mgr->SetInputEventHandler(esdH);
+
+
+  // Create containers for input/output
+  cinput = mgr->CreateContainer("cchain", TChain::Class(), AliAnalysisManager::kInputContainer);
+  coutput = mgr->CreateContainer("chist", TList::Class(),    AliAnalysisManager::kOutputContainer, "LRC.ESD.PROOFtest.root");
+  // Connect input/output
+  mgr->ConnectInput(task, 0, cinput);
+  mgr->ConnectOutput(task, 0, coutput);
+  mgr->InitAnalysis();
+  mgr->PrintStatus();
+
+ mgr->StartAnalysis("proof", inputName);
+
+  
+
+};
+
+void runLRCInteractive(const char* inputName= "wn.xml") {
+  
+  printf("  ------------------------------------------\n");
+  printf(" # LRC local-interactive run manager \n");
+  cout<<"  # Task from :"<<gSystem->pwd()<<"\n";
+  cout<<"  # Collection :"<<inputName<<"\n";
+
+  cout<<"*** Connect to AliEn ***\n";
+  TGrid::Connect("alien://","anivanov");
+
+  cout<<"  # Loadnig libs...\n";
+  
+  TStopwatch timer;
+  timer.Start();
+  gSystem->Load("libTree.so");
+  gSystem->Load("libGeom.so");
+  gSystem->Load("libVMC.so");
+  gSystem->Load("libPhysics.so");
+  gSystem->Load("libSTEERBase.so");
+  gSystem->Load("libESD.so");
+  gSystem->Load("libAOD.so");
+  gSystem->Load("libANALYSIS.so");
+  gSystem->Load("libANALYSISalice.so");
+  
+  gSystem->Load("libPWG2ebye.so");
+  
+  gROOT->ProcessLine(".include $ALICE_ROOT/include");
+  
+  
+ //___________Compile analysis task using AClic____________//
+ cout<<"  # Compiling analysis task\n";
+  gROOT->LoadMacro("AliAnalysisTaskLRC.cxx+g");
+  
+  
+   
+    TAlienCollection * myCollection = 
+       new TAlienCollection("wn.xml",100000) ; 
+    if (!myCollection) { 
+       cout << "XML collection file: " << xmlFileName << " not found" << endl;
+       return;
+    }
+
+    TChain* chain = new TChain("esdTree");
+    
+    cout << "Preparing the file list" << endl; 
+    myCollection->Reset() ; 
+    while ( myCollection->Next() ) {
+       cout << "Adding ESD file: " << myCollection->GetTURL("") << endl; 
+       chain->Add(myCollection->GetTURL("")) ; 
+    }
+    
+
+  
+  AliAnalysisManager *mgr = new AliAnalysisManager("Local-Interactive_LRC_Manager");
+  AliESDInputHandler* esdH = new AliESDInputHandler();
+  
+  mgr->SetInputEventHandler(esdH);  
+  //____________________________________________//
+  AliAnalysisTaskLRC *task1 = new AliAnalysisTaskLRC("TaskLRC");
+  mgr->AddTask(task1);
+  
+  task1->SetETAWindows(-0.7,0.0,0.3,1.0);
+  
+  // Create containers for input/output
+  AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer);
+  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("chist1", TList::Class(),AliAnalysisManager::kOutputContainer,"LRC.ESD.Local-Interactive.root");
+  
+  //____________________________________________//
+  mgr->ConnectInput(task1,0,cinput1);
+  mgr->ConnectOutput(task1,0,coutput1);
+  if (!mgr->InitAnalysis()) return;
+  mgr->PrintStatus();
+  mgr->StartAnalysis("local",chain);
+
+  timer.Stop();
+  timer.Print();
+}
index 10a1eac94eb57ce5bedee1ebdce20dbd0f50d717..717f5e41420c81c2472741a6de6daaea07764245 100644 (file)
@@ -61,7 +61,7 @@ AliProtonAnalysisBase::AliProtonAnalysisBase() :
   fMaxDCA3DFlag(kFALSE), fMaxDCA3DTPCFlag(kFALSE),
   fMaxConstrainChi2Flag(kFALSE),
   fITSRefitFlag(kFALSE), fTPCRefitFlag(kFALSE),
-  fESDpidFlag(kFALSE), fTPCpidFlag(kFALSE),
+  fESDpidFlag(kFALSE), fTPCpidFlag(kFALSE), fTOFpidFlag(kFALSE),
   fPointOnITSLayer1Flag(0), fPointOnITSLayer2Flag(0),
   fPointOnITSLayer3Flag(0), fPointOnITSLayer4Flag(0),
   fPointOnITSLayer5Flag(0), fPointOnITSLayer6Flag(0),
@@ -428,6 +428,13 @@ Bool_t AliProtonAnalysisBase::IsAccepted(AliESDEvent *esd,
       return kFALSE;
     }
   }
+  if(fTOFpidFlag) {
+    if ((track->GetStatus() & AliESDtrack::kTOFpid) == 0) {
+      if(fDebugMode)
+       Printf("IsAccepted: Track rejected because it has no TOF pid flag");
+      return kFALSE;
+    }
+  }
 
   return kTRUE;
 }
index c19cfde291e8e2b002da8921d50e43aec2c64eab..4cb25143ba4f952c53002f77c22f0682ae0a4a2d 100644 (file)
@@ -217,6 +217,8 @@ class AliProtonAnalysisBase : public TObject {
   Bool_t  IsUsedESDpid() const {return fESDpidFlag;}
   void    SetTPCpid() {fTPCpidFlag = kTRUE;}
   Bool_t  IsUsedTPCpid() const {return fTPCpidFlag;}
+  void    SetTOFpid() {fTOFpidFlag = kTRUE;}
+  Bool_t  IsUsedTOFpid() const {return fTOFpidFlag;}
 
   TCanvas *GetListOfCuts();
 
@@ -281,7 +283,7 @@ class AliProtonAnalysisBase : public TObject {
   Bool_t fMaxDCA3DFlag, fMaxDCA3DTPCFlag; //shows if this cut is used or not
   Bool_t fMaxConstrainChi2Flag; //shows if this cut is used or not
   Bool_t fITSRefitFlag, fTPCRefitFlag; //shows if this cut is used or not
-  Bool_t fESDpidFlag, fTPCpidFlag; //shows if this cut is used or not
+  Bool_t fESDpidFlag, fTPCpidFlag, fTOFpidFlag; //shows if this cut is used or not
   Bool_t fPointOnITSLayer1Flag, fPointOnITSLayer2Flag; //shows if this cut is used or not
   Bool_t fPointOnITSLayer3Flag, fPointOnITSLayer4Flag; //shows if this cut is used or not
   Bool_t fPointOnITSLayer5Flag, fPointOnITSLayer6Flag; //shows if this cut is used or not
index 0eb3b747396ba9d28ac438521a2caed7ad92ca1e..a86dc465e77046ed2b5f6ca867a777102d11790d 100644 (file)
@@ -99,6 +99,7 @@ AliProtonAnalysisBase *GetProtonAnalysisBaseObject(const char* analysisLevel = "
       baseAnalysis->SetMinITSClusters(5);
       baseAnalysis->SetITSRefit();
       baseAnalysis->SetESDpid();
+      baseAnalysis->SetTOFpid();
       break;
     default:
       break;
@@ -143,7 +144,7 @@ AliProtonAnalysisBase *GetProtonAnalysisBaseObject(const char* analysisLevel = "
     }//PID mode
   }//ESD
   if(analysisLevel == "MC") 
-    baseAnalysis->SetPhaseSpace(56, -1.0, 1.0, 16, 0.1, 1.5);
+    baseAnalysis->SetPhaseSpace(10, -0.5, 0.5, 16, 0.5, 0.9);
 
   return baseAnalysis;
 }
index ae0363f0f3d152b70289f73abdd98cdb78e5e76d..04e916fd99cd633b68b1de5b659813f0fdcb9d98 100644 (file)
@@ -22,14 +22,14 @@ void runProtonAnalysis(const char* esdAnalysisType = "Hybrid",
   TStopwatch timer;
   timer.Start();
   
-  runLocal("ESD",
+  /*runLocal("ESD",
           esdAnalysisType,
           pidMode,
-          "/home/pchrist/ALICE/Baryons/QA/Local");
+          "/home/pchrist/ALICE/Baryons/QA/Local");*/
   //runInteractive("ESD",esdAnalysisType,pidMode,"tag.xml");
   //runBatch("ESD",esdAnalysisType,pidMode,"wn.xml");  
-  /*runProof("ESD",esdAnalysisType,pidMode
-    200000,"/COMMON/COMMON/LHC08c11_10TeV_0.5T",);*/
+  runProof("ESD",esdAnalysisType,pidMode,
+          500000,0,"/COMMON/COMMON/LHC09a4_run8100X#esdTree");
   
   timer.Stop();
   timer.Print();
@@ -294,7 +294,7 @@ void runBatch(const char* mode = "ESD",
 void runProof(const char* mode = "ESD",
              const char* analysisType = 0x0,
              const char* pidMode = 0x0,
-             Int_t stats = 0, 
+             Int_t stats = 0, Int_t startingPoint = 0,
              const char* dataset = 0x0) {  
   TString smode = mode;
   TString outputFilename = "Protons."; outputFilename += mode;
@@ -303,6 +303,7 @@ void runProof(const char* mode = "ESD",
   }
   outputFilename += ".root";
 
+  gEnv->SetValue("XSec.GSI.DelegProxy","2");
   printf("****** Connect to PROOF *******\n");
   TProof::Open("alicecaf.cern.ch"); 
   gProof->SetParallel();
@@ -346,9 +347,10 @@ void runProof(const char* mode = "ESD",
   mgr->AddTask(taskProtons);
 
   // Create containers for input/output
-  AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("dataChain",
+  /*AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("dataChain",
                                                           TChain::Class(),
-                                                          AliAnalysisManager::kInputContainer);
+                                                          AliAnalysisManager::kInputContainer);*/
+  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("outputList",
                                                             TList::Class(),
                                                            AliAnalysisManager::kOutputContainer,
@@ -361,7 +363,7 @@ void runProof(const char* mode = "ESD",
   mgr->PrintStatus();
 
   if(dataset)
-    mgr->StartAnalysis("proof",dataset,stats);
+    mgr->StartAnalysis("proof",dataset,stats,startingPoint);
   else {
     // You should get this macro and the txt file from:
     // http://aliceinfo.cern.ch/Offline/Analysis/CAF/
index 9bab9d1cf2b0bb8e413eb617a9ff9668db0af793..5e88c7f9e2606e3f95345fc88f61e5811c865877 100644 (file)
@@ -103,9 +103,10 @@ void runLocal(const char* mode = "ESD",
   mgr->AddTask(taskProtonsQA);
 
   // Create containers for input/output
-  AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("dataChain",
+  /*AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("dataChain",
                                                           TChain::Class(),
-                                                          AliAnalysisManager::kInputContainer);
+                                                          AliAnalysisManager::kInputContainer);*/
+  AliAnalysisDataContainer *cinput1  = mgr->GetCommonInputContainer();
   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("globalQAList", 
                                                            TList::Class(),
                                                            AliAnalysisManager::kOutputContainer,
@@ -229,9 +230,10 @@ void runInteractive(const char* mode = "ESD",
   mgr->AddTask(taskProtonsQA);
 
   // Create containers for input/output
-  AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("dataChain",
+  /*AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("dataChain",
                                                            TChain::Class(),
-                                                           AliAnalysisManager::kInputContainer);
+                                                           AliAnalysisManager::kInputContainer);*/
+  AliAnalysisDataContainer *cinput1  = mgr->GetCommonInputContainer();
   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("globalQAList", 
                                                            TList::Class(),
                                                            AliAnalysisManager::kOutputContainer,
@@ -347,9 +349,10 @@ void runBatch(const char* mode = "ESD",
   mgr->AddTask(taskProtonsQA);
 
   // Create containers for input/output
-  AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("dataChain",
+  /*AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("dataChain",
                                                           TChain::Class(),
-                                                          AliAnalysisManager::kInputContainer);
+                                                          AliAnalysisManager::kInputContainer);*/
+  AliAnalysisDataContainer *cinput1  = mgr->GetCommonInputContainer();
   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("globalQAList", 
                                                            TList::Class(),
                                                            AliAnalysisManager::kOutputContainer,
@@ -420,6 +423,7 @@ void runProof(const char* mode = "ESD",
   outputFilename4 += ".root"; //Reco and PID efficiency
   TString outputFilename5 = "Vertex.QA.root"; //vertex QA
 
+  gEnv->SetValue("XSec.GSI.DelegProxy","2");
   printf("****** Connect to PROOF *******\n");
   TProof::Open("alicecaf.cern.ch"); 
   gProof->SetParallel();
@@ -461,9 +465,10 @@ void runProof(const char* mode = "ESD",
   mgr->AddTask(taskProtonsQA);
 
   // Create containers for input/output
-  AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("dataChain",
+  /*AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("dataChain",
                                                            TChain::Class(),
-                                                           AliAnalysisManager::kInputContainer);
+                                                           AliAnalysisManager::kInputContainer);*/
+  AliAnalysisDataContainer *cinput1  = mgr->GetCommonInputContainer();
   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("globalQAList", 
                                                            TList::Class(),
                                                            AliAnalysisManager::kOutputContainer,