]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSTrigger.cxx
A default AliITSRecoParam object is defined in AliITSReconstructor as static data...
[u/mrichter/AliRoot.git] / ITS / AliITSTrigger.cxx
index 800ad8c12fada6603b87bdc7fa357bfc3a2d6689..423d2248e9e40d5bfa0ca16470886671a5452ff9 100644 (file)
@@ -16,6 +16,7 @@
 
 /* $Id$ */
 
+#include <TClonesArray.h>
 
 #include "AliLog.h"
 #include "AliRun.h"
@@ -47,11 +48,10 @@ ClassImp(AliITSTrigger)
 AliITSTrigger::AliITSTrigger()
   : AliTriggerDetector(),
 fGlobalFOThreshold(1),
-fHighMultFOThreshold(150){
+fHighMultFOThreshold(190){
 
   //standard constructor
   SetName("ITS");
-  CreateInputs();
 
   // set parameters to define trigger condition thresholds
   //fGlobalFOThreshold = 1;
@@ -66,8 +66,8 @@ void AliITSTrigger::CreateInputs()
    // Do not create inputs again!!
    if( fInputs.GetEntriesFast() > 0 ) return;
    
-   fInputs.AddLast( new AliTriggerInput( "ITS_SPD_GFO_L0",     "Global, Fast OR all detectors", 0x01 ) );
-   fInputs.AddLast( new AliTriggerInput( "ITS_SPD_HMULT_L0",   "High Multiplicity",             0x02 ) );
+   fInputs.AddLast( new AliTriggerInput( "SPD_GFO_L0",     "SPD", 0 ) );
+   fInputs.AddLast( new AliTriggerInput( "SPD_HMULT_L0",   "SPD", 0 ) );
 
 }
 
@@ -110,16 +110,19 @@ void AliITSTrigger::MultiplicityTriggers(TObjArray* digDet, TTree* treeD, AliITS
 {
   // simple FO triggers that only cares about the multiplicity
 
+  const Int_t nChipsInModule = 5;
   Int_t startSPD = geom->GetStartSPD();
   Int_t lastSPD  = geom->GetLastSPD();
 
   Int_t totalNumberOfFO = 0;
+  Int_t totalNumberOfFOLay1 = 0;
   Int_t ndigitsInChip[5];
 
   // loop over modules (ladders)
   for (Int_t moduleIndex=startSPD; moduleIndex<lastSPD+1; moduleIndex++) {
     treeD->GetEvent(moduleIndex);
     TClonesArray* digits = (TClonesArray*) (digDet->At(0)); // SPD only.
+    Int_t lay,stav,det;  geom->GetModuleId(moduleIndex,lay,stav,det);
     
     // get number of digits in this module
     Int_t ndigitsInModule = digits->GetEntriesFast();
@@ -131,13 +134,14 @@ void AliITSTrigger::MultiplicityTriggers(TObjArray* digDet, TTree* treeD, AliITS
     for( Int_t iDig=0; iDig<ndigitsInModule; iDig++ ) {
        AliITSdigitSPD* dp = (AliITSdigitSPD*) digits->At(iDig);
        Int_t column = dp->GetCoord1();
-       Int_t isChip = Int_t(column/32.);
+       Int_t isChip = nChipsInModule - Int_t(column/32.) - 1;
        ndigitsInChip[isChip]++;
     }
     // get number of FOs in the module
     for( Int_t ifChip=0; ifChip<5; ifChip++ ) {
        if( ndigitsInChip[ifChip] >= 1 ) {
-               totalNumberOfFO++;
+            totalNumberOfFO++;
+            if(lay==1) totalNumberOfFOLay1++;
        }       
     }
   // end of loop over modules
@@ -145,10 +149,10 @@ void AliITSTrigger::MultiplicityTriggers(TObjArray* digDet, TTree* treeD, AliITS
 
   // produce input trigger condition
   if (totalNumberOfFO>=fGlobalFOThreshold) 
-    SetInput( "ITS_SPD_GFO_L0" );
+    SetInput( "SPD_GFO_L0" );
 
-  if (totalNumberOfFO>=fHighMultFOThreshold) 
-    SetInput( "ITS_SPD_HMULT_L0" );
+  if (totalNumberOfFOLay1>=fHighMultFOThreshold) 
+    SetInput( "SPD_HMULT_L0" );
 
   return;