]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTriggerDecision.cxx
Fixes to coding conventions violations
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerDecision.cxx
index 7c25b613bcce3186c65881087b1272e80ea245ce..b02773d36e75b1fa37673c074deb9272ede6c3a1 100644 (file)
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
-/*
-$Log$
-Revision 1.10  2002/10/23 07:24:56  alibrary
-Introducing Riostream.h
-
-Revision 1.9  2001/03/23 17:31:32  pcrochet
-correct access to digits in SetBit()
-
-Revision 1.8  2001/03/20 16:13:01  pcrochet
-bug fixed in the rejection of soft background (thanks to FM)
-
-Revision 1.7  2001/03/20 13:32:37  egangler
-includes cleanup
-
-Revision 1.6  2001/01/26 21:57:09  morsch
-Use access functions to AliMUONDigit member data.
-
-Revision 1.5  2000/10/02 16:58:29  egangler
-Cleaning of the code :
--> coding conventions
--> void Streamers
--> some useless includes removed or replaced by "class" statement
-
-Revision 1.4  2000/07/03 11:54:57  morsch
-AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
-The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
-
-Revision 1.3  2000/06/25 17:02:19  pcrochet
-scope problem on HP, i declared once, pow replaced by TMath::Power (PH)
-
-Revision 1.2  2000/06/15 07:58:49  morsch
-Code from MUON-dev joined
-
-Revision 1.1.2.8  2000/06/14 14:54:34  morsch
-Complete redesign, make use of TriggerCircuit and TriggerLut (PC)
-
-Revision 1.1.2.5  2000/04/26 19:59:57  morsch
-Constructor added.
 
-Revision 1.1.2.4  2000/04/26 12:31:30  morsch
-Modifications by P. Crochet:
-- adapted to the new Trigger chamber geometry
-- condition on soft background added
-- contructor added in AliMUONTriggerDecision.h
-- single-undefined taken into account in the output of GlobalTrigger()
-- some bugs fixed
-
-Revision 1.1.2.3  2000/03/21 09:29:58  morsch
-Put back comments
-
-Revision 1.1.2.2  2000/03/21 09:24:34  morsch
-Author and responsible for the code: Philippe Crochet
-*/
+/* $Id$ */
 
 #include "AliMUONTriggerCircuit.h"
 #include "AliMUONTriggerDecision.h"
@@ -72,6 +21,8 @@ Author and responsible for the code: Philippe Crochet
 #include "AliMUONHitMapA1.h"
 #include "AliRun.h"
 #include "AliMUON.h"
+#include "AliRunLoader.h"
+#include "AliLoader.h"
 #include "AliSegmentation.h"
 #include "AliMUONResponse.h"
 #include "AliMUONChamber.h"
@@ -240,32 +191,24 @@ void AliMUONTriggerDecision::SetBit(){
 // 3) remove soft background
 // 4) set the bit patterns
 
-  AliMUON *pMUON  = (AliMUON*)gAlice->GetModule("MUON");  
+
+  AliMUON *pMUON  = (AliMUON*)gAlice->GetDetector("MUON");  
   AliMUONTriggerCircuit* triggerCircuit;
+  AliRunLoader * rl = AliRunLoader::GetRunLoader();
+  AliLoader * gime  = rl->GetLoader("MUONLoader");
 
   for (Int_t chamber=11; chamber<15; chamber++){
     for (Int_t cathode=1; cathode<3; cathode++){
       
-      AliMUONChamber*   iChamber;
+      AliMUONChamber*   iChamber = &(pMUON->Chamber(chamber-1));
       AliSegmentation*  segmentation;
-      
-      TClonesArray *muonDigits  = pMUON->DigitsAddress(chamber-1);
-      if (muonDigits == 0) return;
-      
-      gAlice->ResetDigits();
-      Int_t nent = 0;
-      
-      if (gAlice->TreeD()) {
-       nent = (Int_t) gAlice->TreeD()->GetEntries();
-       //printf(" entries %d \n", nent);
-       //     gAlice->TreeD()->GetEvent(nent-2+cathode-1);
-       gAlice->TreeD()->GetEvent(cathode-1);
-      }
-      
+      gime->TreeD()->GetEvent(cathode-1);
+      TClonesArray *muonDigits = pMUON->DigitsAddress(chamber-1);
       Int_t ndigits = muonDigits->GetEntriesFast();
-      if (ndigits == 0) return;
+//      printf("\n 1 Found %d digits in %p %d \n ", ndigits, muonDigits,chamber-1);
+//    if (ndigits == 0) return;
       
-      iChamber = &(pMUON->Chamber(chamber-1));
+//      iChamber = &(pMUON->Chamber(chamber-1));
       segmentation=iChamber->SegmentationModel(cathode);
       AliMUONDigit  *mdig;
       
@@ -274,6 +217,7 @@ void AliMUONTriggerDecision::SetBit(){
 // get the center of the pad Id 
        Int_t ix=mdig->PadX();
        Int_t iy=mdig->PadY();
+
 // get the sum of the coded charge 
 // see coding convention in AliMUONChamberTrigger::DisIntegration      
        Int_t sumCharge=0;
@@ -281,7 +225,7 @@ void AliMUONTriggerDecision::SetBit(){
          sumCharge=sumCharge+mdig->TrackCharge(icharge);
        }
 // apply condition on soft background  
-       Int_t testCharge=sumCharge-(Int_t(sumCharge/10))*10;
+       Int_t testCharge=sumCharge-(Int_t(sumCharge/10))*10;    
        if(sumCharge<=10||testCharge>0) {         
 // code pad
          Int_t code=TMath::Abs(ix)*100+iy;
@@ -379,6 +323,7 @@ void AliMUONTriggerDecision::SetBit(){
          } // if cathode
        }  // remove soft background
       }   // end loop on digit
+      pMUON->ResetDigits();
     }    // end loop on cathode
   }     // end loop on chamber
 }