]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONTriggerDecision.cxx
Modifications needed by the HBT analysis (P.Skowronski)
[u/mrichter/AliRoot.git] / MUON / AliMUONTriggerDecision.cxx
index 898e3c8a9628fd086678cfaa8e7443f97bf2e4c8..ca802177831d67254b78dd9f847a2b8870de641a 100644 (file)
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
-/*
-$Log$
-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"
@@ -63,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"
@@ -77,7 +37,7 @@ Author and responsible for the code: Philippe Crochet
 #include <TGraph.h> 
 #include <TPostScript.h> 
 #include <TMinuit.h> 
-#include <iostream.h> 
+#include <Riostream.h> 
 
 //----------------------------------------------------------------------
 ClassImp(AliMUONTriggerDecision)
@@ -141,7 +101,6 @@ AliMUONTriggerDecision::~AliMUONTriggerDecision()
 //----------------------------------------------------------------------
 void AliMUONTriggerDecision::Trigger(){
 // main method of the class which calls the overall Trigger procedure
-//  cout << " In AliMUONTriggerDecision::Trigger " << "\n";
 
   ResetBit();
   SetBit();
@@ -185,7 +144,6 @@ void AliMUONTriggerDecision::Trigger(){
 
 // call Global Trigger
   GlobalTrigger();
-  //  cout << " Leaving AliMUONTriggerDecision::Trigger " << "\n";
 }
 
 //----------------------------------------------------------------------
@@ -233,26 +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=(Int_t)gAlice->TreeD()->GetEntries();
-      gAlice->TreeD()->GetEvent(nent-2+cathode-1);
+      gime->TreeD()->GetEvent(cathode-1);
+      TClonesArray *muonDigits = pMUON->GetMUONData()->Digits(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;
       
@@ -261,6 +217,8 @@ void AliMUONTriggerDecision::SetBit(){
 // get the center of the pad Id 
        Int_t ix=mdig->PadX();
        Int_t iy=mdig->PadY();
+       printf("digits %d ix %d iy %d \n",digit,ix,iy);
+
 // get the sum of the coded charge 
 // see coding convention in AliMUONChamberTrigger::DisIntegration      
        Int_t sumCharge=0;
@@ -268,7 +226,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;
@@ -366,6 +324,7 @@ void AliMUONTriggerDecision::SetBit(){
          } // if cathode
        }  // remove soft background
       }   // end loop on digit
+      pMUON->GetMUONData()->ResetDigits();
     }    // end loop on cathode
   }     // end loop on chamber
 }  
@@ -537,18 +496,18 @@ void AliMUONTriggerDecision::TrigX(Int_t ch1q[16], Int_t ch2q[16],
 
 //--- 
   if(fDebug==3||fDebug==5) {
-    cout << "===============================================================" << "\n";
-    cout << " X plane after sgle and dble " << " \n";
-    cout << "                       0987654321098765432109876543210";
-    cout << "\n SGLE1                 ";
-    for (istrip=30; istrip>=0; istrip--) { cout << (!sgleHit1[istrip]); }
-    cout << "\n DBLE1                 ";
-    for (istrip=30; istrip>=0; istrip--) { cout << dbleHit1[istrip]; }
-    cout << "\n SGLE2 ";
-    for (istrip=62; istrip>=0; istrip--) { cout << (!sgleHit2[istrip]); }
-    cout << "\n DBLE2 ";
-    for (istrip=62; istrip>=0; istrip--) { cout << dbleHit2[istrip]; }
-    cout << "\n       210987654321098765432109876543210987654321098765432109876543210" << "\n";
+    printf("===============================================================\n");
+    printf(" X plane after sgle and dble \n");
+    printf("                       0987654321098765432109876543210");
+    printf("\n SGLE1                 ");
+    for (istrip=30; istrip>=0; istrip--) printf("%i",(!sgleHit1[istrip]));
+    printf("\n DBLE1                 ");
+    for (istrip=30; istrip>=0; istrip--) printf("%i",dbleHit1[istrip]);
+    printf("\n SGLE2 ");
+    for (istrip=62; istrip>=0; istrip--) printf("%i",(!sgleHit2[istrip]));
+    printf("\n DBLE2 ");
+    for (istrip=62; istrip>=0; istrip--) printf("%i",dbleHit2[istrip]);
+    printf("\n       210987654321098765432109876543210987654321098765432109876543210\n");
   }
   
 //---------------------------------------------------------
@@ -612,16 +571,13 @@ void AliMUONTriggerDecision::TrigX(Int_t ch1q[16], Int_t ch2q[16],
 
   //-----------
  if(fDebug==3||fDebug==5) {
-    cout << "===============================================================" << "\n";
+   printf("===============================================================\n");
    for (i=30; i>=0; i--) {
-     cout << i << "\t ";
-     for (istrip=31; istrip>=0; istrip--) {
-       cout << rearImage[i][istrip];
-     }
-     cout << " " << "\n";
+   printf("%i \t",i);
+   for (istrip=31; istrip>=0; istrip--) printf("%i",rearImage[i][istrip]);
+   printf("\n");   
    }
  }
-  
 
 //---------------------------------------------------------
 // step # 3 : calculate deviation
@@ -711,14 +667,14 @@ void AliMUONTriggerDecision::TrigX(Int_t ch1q[16], Int_t ch2q[16],
   }
   
 //---
 if(fDebug==3||fDebug==5) {
-    cout << "===============================================================" << "\n";
-    for (i=30; i>=0; i--) {
-      cout << i << "\t ";
-      for (istrip=5; istrip>=0; istrip--) { cout << dev[i][istrip]; }
-      cout << " " << "\n";
-    }
 }
+ if(fDebug==3||fDebug==5) {
+   printf("===============================================================\n");
+   for (i=30; i>=0; i--) {
+     printf("%i \t",i);
+     for (istrip=5; istrip>=0; istrip--) printf("%i",dev[i][istrip]);
+     printf(" \n");
+   }
+ }
 
 //---------------------------------------------------------
 // step # 4 : sort deviation
@@ -734,14 +690,12 @@ void AliMUONTriggerDecision::TrigX(Int_t ch1q[16], Int_t ch2q[16],
 
 //--    
   if(fDebug==3||fDebug==5) {
-    cout << "===============================================================" << "\n";
-    cout << " sorting : 1st level " << "\n";
+    printf("===============================================================\n");
+    printf(" sorting : 1st level \n");
     for (i=15; i>=0; i--) {
-      cout << i << "\t " << bga1[i] << "\t";   
-      for (j=5; j>=0; j--) {
-       cout << tmpbga1[i][j]; 
-      }
-      cout << " " << "\n";
+      printf("\t %i \t",bga1[i]);      
+      for (j=5; j>=0; j--) printf("%i",tmpbga1[i][j]); 
+     printf(" \n");
     }
   }
 
@@ -751,31 +705,27 @@ void AliMUONTriggerDecision::TrigX(Int_t ch1q[16], Int_t ch2q[16],
 
 //--    
   if(fDebug==3||fDebug==5) {
-    cout << "===============================================================" << "\n";
-    cout << " sorting : 2nd level " << "\n";
+    printf("===============================================================\n");
+    printf(" sorting : 2nd level \n");
     for (i=7; i>=0; i--) {
-      cout << i << "\t " << bga2[i] << "\t";   
-      for (j=5; j>=0; j--) {
-       cout << tmpbga2[i][j]; 
-      }
-      cout << " " << "\n";
+      printf("\t %i \t",bga2[i]);      
+      for (j=5; j>=0; j--) printf("%i",tmpbga1[i][j]);         
+      printf(" \n");
     }
   }
-    
+  
   for (i=0; i<4; i++) {  
     Sort2x5(tmpbga2[2*i],tmpbga2[2*i+1],tmpbga3[i],bga3[i]);
   }
 
 //--    
   if(fDebug==3||fDebug==5) {
-    cout << "===============================================================" << "\n";
-    cout << " sorting : 3rd level " << "\n";
+    printf("===============================================================\n");
+    printf(" sorting : 3rd level \n");
     for (i=3; i>=0; i--) {
-      cout << i << "\t " << bga3[i] << "\t";   
-      for (j=5; j>=0; j--) {
-       cout << tmpbga3[i][j]; 
-      }
-      cout << " " << "\n";
+      printf("\t %i \t",bga3[i]);      
+      for (j=5; j>=0; j--) printf("%i",tmpbga3[i][j]); 
+      printf(" \n");
     }
   }
 
@@ -785,14 +735,12 @@ void AliMUONTriggerDecision::TrigX(Int_t ch1q[16], Int_t ch2q[16],
 
 //--    
   if(fDebug==3||fDebug==5) {
-    cout << "===============================================================" << "\n";
-    cout << " sorting : 4th level " << "\n";
+    printf("===============================================================\n");
+    printf(" sorting : 4th level \n");
     for (i=1; i>=0; i--) {
-      cout << i << "\t " << bga4[i] << "\t";   
-      for (j=5; j>=0; j--) {
-       cout << tmpbga4[i][j]; 
-      }
-      cout << " " << "\n";
+      printf("\t %i \t",bga4[i]);      
+      for (j=5; j>=0; j--) printf("%i",tmpbga4[i][j]);
+      printf(" \n");
     }
   }
   
@@ -817,14 +765,14 @@ void AliMUONTriggerDecision::TrigX(Int_t ch1q[16], Int_t ch2q[16],
     tmpAd=minDevStrip[1]+minDevStrip[2]*2+minDevStrip[3]*4+minDevStrip[4]*8;
     if (tmpAd<=15) minDevStrip[0]=bga1[tmpAd];
 
-  if(fDebug==3||fDebug==5) {
-    cout << "===============================================================" << "\n";
-    cout << "minDevStrip = ";
-    for  (i=4; i>=0; i--) {cout << minDevStrip[i];}
-    cout << " minDev = ";
-    for  (i=4; i>=0; i--) {cout << minDev[i];} 
-    cout << " " << "\n";
-    cout << "===============================================================" << "\n";
+    if(fDebug==3||fDebug==5) {
+    printf("===============================================================\n");
+    printf("minDevStrip = ");
+    for  (i=4; i>=0; i--) printf("%i",minDevStrip[i]);
+    printf(" minDev = ");
+    for  (i=4; i>=0; i--) printf("%i",minDev[i]); 
+    printf(" \n");
+    printf("===============================================================\n");
   }
 
 }
@@ -927,31 +875,23 @@ void AliMUONTriggerDecision::TrigY(Int_t y1[16], Int_t y2[16],
 
 // debug
   if(fDebug==4||fDebug==5) {
-    cout << "===============================================================" << "\n";  
-    cout << " Y plane after PreHandling x2m x2ud orMud " 
-        << x2m << " , " << x2ud << " , " << orMud[0] << orMud[1] << "\n"; 
-    cout << "                            ";
+    printf("===============================================================\n");  
+    printf(" Y plane after PreHandling x2m x2ud orMud %i %i %i %i \n",
+          x2m,x2ud,orMud[0],orMud[1]);
+    printf("                            ");
     for (istrip=15; istrip>=0; istrip--) {
-      if (istrip>9) cout << istrip-10*Int_t(istrip/10);
-      if (istrip<10) cout << istrip;
+      if (istrip>9)  printf("%i",istrip-10*Int_t(istrip/10));
+      if (istrip<10) printf("%i",istrip);
     }  
-    cout << "\n YMC11                      ";
-    for (istrip=15; istrip>=0; istrip--) {
-      cout << ch1[istrip]; 
-    }
-    cout << "\n YMC12                      ";
-    for (istrip=15; istrip>=0; istrip--) {
-      cout << ch2[istrip]; 
-    }
-    cout << "\n YMC21                      ";
-    for (istrip=15; istrip>=0; istrip--) {
-      cout << ch3[istrip]; 
-    }
-    cout << "\n YMC22                      ";
-    for (istrip=15; istrip>=0; istrip--) {
-      cout << ch4[istrip]; 
-    }
-    cout << " \n"; 
+    printf("\n YMC11                      ");
+    for (istrip=15; istrip>=0; istrip--) printf("%i",ch1[istrip]); 
+    printf("\n YMC12                      ");
+    for (istrip=15; istrip>=0; istrip--) printf("%i",ch2[istrip]); 
+    printf("\n YMC21                      ");
+    for (istrip=15; istrip>=0; istrip--) printf("%i",ch3[istrip]); 
+    printf("\n YMC22                      ");
+    for (istrip=15; istrip>=0; istrip--) printf("%i",ch4[istrip]); 
+    printf(" \n"); 
   }
 //debug
   
@@ -972,30 +912,22 @@ void AliMUONTriggerDecision::TrigY(Int_t y1[16], Int_t y2[16],
 
   //debug
   if(fDebug==4||fDebug==5) {
-    cout << "===============================================================" << "\n";
-    cout << " Y plane after sgle dble " << "\n"
-    cout << "                            ";
+    printf("===============================================================\n");
+    printf(" Y plane after sgle dble \n")
+    printf("                            ");
     for (istrip=15; istrip>=0; istrip--) {
-      if (istrip>9) { cout << istrip-10*Int_t(istrip/10);}
-      if (istrip<10) { cout << istrip;}
+      if (istrip>9)  printf("%i",istrip-10*Int_t(istrip/10));
+      if (istrip<10) printf("%i",istrip);
     }  
-    cout << "\n SGLE1                      ";
-    for (istrip=15; istrip>=0; istrip--) {
-      cout << sgle1[istrip]; 
-    }
-    cout << "\n DBLE1                      ";
-    for (istrip=15; istrip>=0; istrip--) {
-      cout << dble1[istrip]; 
-    }
-    cout << "\n SGLE2                      ";
-    for (istrip=15; istrip>=0; istrip--) {
-      cout << sgle2[istrip]; 
-    }
-    cout << "\n DBLE2                      ";
-    for (istrip=15; istrip>=0; istrip--) {
-      cout << dble2[istrip]; 
-    }
-    cout << " \n"; 
+    printf("\n SGLE1                      ");
+    for (istrip=15; istrip>=0; istrip--) printf("%i",sgle1[istrip]); 
+    printf("\n DBLE1                      ");
+    for (istrip=15; istrip>=0; istrip--) printf("%i",dble1[istrip]); 
+    printf("\n SGLE2                      ");
+    for (istrip=15; istrip>=0; istrip--) printf("%i",sgle2[istrip]); 
+    printf("\n DBLE2                      ");
+    for (istrip=15; istrip>=0; istrip--) printf("%i",dble2[istrip]); 
+    printf(" \n"); 
   }
   //debug
 
@@ -1036,18 +968,16 @@ void AliMUONTriggerDecision::TrigY(Int_t y1[16], Int_t y2[16],
 
 //debug
   if(fDebug==4||fDebug==5) {
-    cout << "===============================================================" << "\n";
-    cout << " Y plane frontImage\n";
-    cout << "                            ";
+    printf("===============================================================\n");
+    printf(" Y plane frontImage\n");
+    printf("                            ");
   for (istrip=15; istrip>=0; istrip--) {
-    if (istrip>9) cout << istrip-10*Int_t(istrip/10);
-    if (istrip<10) cout << istrip;
+    if (istrip>9)  printf("%i",istrip-10*Int_t(istrip/10));
+    if (istrip<10) printf("%i",istrip);
   }
-    cout << "\n                            ";
-    for (istrip=15; istrip>=0; istrip--) {
-      cout << frontImage[istrip]; 
-    }
-    cout << "\n";
+  printf("\n                            ");
+  for (istrip=15; istrip>=0; istrip--) printf("%i",frontImage[istrip]); 
+  printf("\n");
   }
 //debug
 
@@ -1150,22 +1080,21 @@ void AliMUONTriggerDecision::LocalTrigger(Int_t icirc,
     if (fDebug>1) {
       Float_t pt= // get ptCal corresponding to istripX1Circ/idev/iStripY
       triggerCircuit->PtCal(fStripX11[icirc],fDev[icirc],fStripY11[icirc]);
-      cout << "-------------------------------------------" << "\n";
-      cout << " Local Trigger info for circuit Id " << idCircuit 
-          << " (number " << icirc << ")" << "\n";
-      cout << " istripX1 signDev deviation istripY = " 
-          << istripX1Circ << " , " << signDev 
-          << " , " << deviation << " , " << iStripY << "\n";      
-      cout << " pt = " << pt << " (GeV/c) " << "\n";
-      cout << "-------------------------------------------" << "\n";
-      cout << " Local Trigger Lut Output = Lpt : " ;
-      for (i=1; i>=0; i--) { cout << fLutLpt[icirc][i] ; }
-      cout << " Hpt : ";
-      for (i=1; i>=0; i--) { cout << fLutHpt[icirc][i] ; }
-      cout << " Apt : ";
-      for (i=1; i>=0; i--) { cout << fLutApt[icirc][i] ; }       
-      cout << "\n";
-      cout << "-------------------------------------------" << "\n";
+      printf("-------------------------------------------\n");
+      printf(" Local Trigger info for circuit Id %i (number %i ) \n",
+            idCircuit,icirc);
+      printf(" istripX1 signDev deviation istripY = %i %i %i %i \n", 
+            istripX1Circ,signDev,deviation,iStripY);      
+      printf(" pt = %f  (GeV/c) \n",pt);
+      printf("-------------------------------------------\n");
+      printf(" Local Trigger Lut Output = Lpt : ");
+      for (i=1; i>=0; i--) printf("%i",fLutLpt[icirc][i]);
+      printf(" Hpt : ");
+      for (i=1; i>=0; i--) printf("%i",fLutHpt[icirc][i]);
+      printf(" Apt : ");
+      for (i=1; i>=0; i--) printf("%i",fLutApt[icirc][i]);
+      printf("\n");
+      printf("-------------------------------------------\n");
     } // fDebug > 1    
   }  // local trigger = 1
 }
@@ -1216,25 +1145,25 @@ void AliMUONTriggerDecision::GlobalTrigger(){
   }
   
   if (fDebug>=1) {
-    cout << "\n";
-    cout << "===================================================" << "\n";
-    cout << " Global Trigger output       " << "Low pt  High pt   All"  << "\n";
-    cout << " number of Single Plus      :\t";
-    for (i=0; i<3; i++) { cout << fGlobalSinglePlus[i] <<"\t";}
-    cout << "\n";
-    cout << " number of Single Minus     :\t";
-    for (i=0; i<3; i++) { cout << fGlobalSingleMinus[i] <<"\t";}
-    cout << "\n";
-    cout << " number of Single Undefined :\t"
-    for (i=0; i<3; i++) { cout << fGlobalSingleUndef[i] <<"\t";}
-    cout << "\n";
-    cout << " number of UnlikeSign pair  :\t"
-    for (i=0; i<3; i++) { cout << fGlobalPairUnlike[i] <<"\t";}
-    cout << "\n";
-    cout << " number of LikeSign pair    :\t";  
-    for (i=0; i<3; i++) { cout << fGlobalPairLike[i] <<"\t";}
-    cout << "\n";
-    cout << "===================================================" << "\n";
+    printf("\n");
+    printf("===================================================\n");
+    printf(" Global Trigger output       Low pt  High pt   All\n");
+    printf(" number of Single Plus      :\t");
+    for (i=0; i<3; i++) printf("%i\t",fGlobalSinglePlus[i]);
+    printf("\n");
+    printf(" number of Single Minus     :\t");
+    for (i=0; i<3; i++) printf("%i\t",fGlobalSingleMinus[i]);
+    printf("\n");
+    printf(" number of Single Undefined :\t")
+    for (i=0; i<3; i++) printf("%i\t",fGlobalSingleUndef[i]);
+    printf("\n");
+    printf(" number of UnlikeSign pair  :\t")
+    for (i=0; i<3; i++) printf("%i\t",fGlobalPairUnlike[i]);
+    printf("\n");
+    printf(" number of LikeSign pair    :\t");  
+    for (i=0; i<3; i++) printf("%i\t",fGlobalPairLike[i]);
+    printf("\n");
+    printf("===================================================\n");
   }
 }
 
@@ -1244,27 +1173,19 @@ void AliMUONTriggerDecision::PrintBitPatXInput(Int_t icirc){
 
     Int_t istrip;
 
-  cout << "-------- TRIGGER INPUT ---------" << "\n";
-  cout << "===============================================================" << "\n";
-  cout << "                            5432109876543210";
-  cout << "\n XMC11                      ";
-  for (istrip=15; istrip>=0; istrip--) {
-    cout << fXbit11[icirc][istrip]; 
-  }
-  cout << "\n XMC12                      ";
-  for (istrip=15; istrip>=0; istrip--) {
-    cout << fXbit12[icirc][istrip]; 
-  }
-  cout << "\n XMC21              ";
-  for (istrip=31; istrip>=0; istrip--) {
-    cout << fXbit21[icirc][istrip]; 
-  }
-  cout << "\n XMC22              ";
-  for (istrip=31; istrip>=0; istrip--) {
-    cout << fXbit22[icirc][istrip]; 
-  }
-  cout << "\n                    ";
-  cout << "10987654321098765432109876543210" << "\n";
+  printf("-------- TRIGGER INPUT ---------\n");
+  printf("===============================================================\n");
+  printf("                            5432109876543210");
+  printf("\n XMC11                      ");
+  for (istrip=15; istrip>=0; istrip--) printf("%i",fXbit11[icirc][istrip]); 
+  printf("\n XMC12                      ");
+  for (istrip=15; istrip>=0; istrip--) printf("%i",fXbit12[icirc][istrip]);
+  printf("\n XMC21              ");
+  for (istrip=31; istrip>=0; istrip--) printf("%i",fXbit21[icirc][istrip]); 
+  printf("\n XMC22              ");
+  for (istrip=31; istrip>=0; istrip--) printf("%i",fXbit22[icirc][istrip]); 
+  printf("\n                    ");
+  printf("10987654321098765432109876543210\n");
 }
 
 //----------------------------------------------------------------------
@@ -1279,52 +1200,40 @@ void AliMUONTriggerDecision::PrintBitPatYInput(Int_t icirc){
   Int_t idCircuit=triggerCircuit->GetIdCircuit();
   Int_t nStrip=triggerCircuit->GetNstripY();
 
-  cout << "---------------------------------------------------------------" << "\n";
-  cout << "                            ";
+  printf("---------------------------------------------------------------\n");
+  printf("                            ");
   for (istrip=nStrip-1; istrip>=0; istrip--) {
-    if (istrip>9) { cout << istrip-10*Int_t(istrip/10);}
-    if (istrip<10) { cout << istrip;}
-  }
-  cout << "\n YMC11                      ";
-  for (istrip=nStrip-1; istrip>=0; istrip--) {
-    cout << fYbit11[icirc][istrip]; 
-  }
-  cout << "\n YMC12                      ";
-  for (istrip=nStrip-1; istrip>=0; istrip--) {
-    cout << fYbit12[icirc][istrip]; 
-  }
-  cout << "\n YMC21                      ";
-  for (istrip=nStrip-1; istrip>=0; istrip--) {
-    cout << fYbit21[icirc][istrip]; 
-  }
-  cout << "\n YMC22                      ";
-  for (istrip=nStrip-1; istrip>=0; istrip--) {
-    cout << fYbit22[icirc][istrip]; 
-  }
-  cout << "\n";
+    if (istrip>9)  printf("%i",istrip-10*Int_t(istrip/10));
+    if (istrip<10) printf("%i",istrip);
+  }
+  printf("\n YMC11                      ");
+  for (istrip=nStrip-1; istrip>=0; istrip--) 
+    printf("%i",fYbit11[icirc][istrip]); 
+  printf("\n YMC12                      ");
+  for (istrip=nStrip-1; istrip>=0; istrip--)
+    printf("%i",fYbit12[icirc][istrip]); 
+  printf("\n YMC21                      ");
+  for (istrip=nStrip-1; istrip>=0; istrip--)
+    printf("%i",fYbit21[icirc][istrip]); 
+  printf("\n YMC22                      ");
+  for (istrip=nStrip-1; istrip>=0; istrip--)
+    printf("%i",fYbit22[icirc][istrip]); 
+  printf("\n");
 // tmp
-  cout << "---------------------------------------------------------------";
-  cout << "\n upper part of circuit " << idCircuit ;
-  cout << "\n UMC21                      ";
-  for (istrip=15; istrip>=0; istrip--) {
-    cout << fYbit21U[icirc][istrip]; 
-  }
-  cout << "\n UMC22                      ";
-  for (istrip=15; istrip>=0; istrip--) {
-    cout << fYbit22U[icirc][istrip]; 
-  }
-
-  cout << "\n lower part of circuit " << idCircuit ;
-  cout << "\n LMC21                      ";
-  for (istrip=15; istrip>=0; istrip--) {
-    cout << fYbit21D[icirc][istrip]; 
-  }
-  cout << "\n LMC22                      ";
-  for (istrip=15; istrip>=0; istrip--) {
-    cout << fYbit22D[icirc][istrip]; 
-  }
-  cout << "\n";
-  cout << "===============================================================" << "\n";
+  printf("---------------------------------------------------------------");
+  printf("\n upper part of circuit %i",idCircuit);
+  printf("\n UMC21                      ");
+  for (istrip=15; istrip>=0; istrip--) printf("%i",fYbit21U[icirc][istrip]); 
+  printf("\n UMC22                      ");
+  for (istrip=15; istrip>=0; istrip--) printf("%i", fYbit22U[icirc][istrip]); 
+
+  printf("\n lower part of circuit %i",idCircuit);
+  printf("\n LMC21                      ");
+  for (istrip=15; istrip>=0; istrip--) printf("%i",fYbit21D[icirc][istrip]);
+  printf("\n LMC22                      ");
+  for (istrip=15; istrip>=0; istrip--) printf("%i",fYbit22D[icirc][istrip]); 
+  printf("\n");
+  printf("===============================================================\n");
 }
 //----------------------------------------------------------------------
 void AliMUONTriggerDecision::PrintLocalOutput(Int_t minDevStrip[5], 
@@ -1334,15 +1243,15 @@ void AliMUONTriggerDecision::PrintLocalOutput(Int_t minDevStrip[5],
 
     Int_t i;
 
-  cout << "===============================================================" << "\n";
-  cout << "-------- TRIGGER OUTPUT --------" << "\n";
-  cout << "minDevStrip = ";
-  for  (i=4; i>=0; i--) {cout << minDevStrip[i];}
-  cout << " minDev = ";
-  for  (i=4; i>=0; i--) {cout << minDev[i];} 
-  cout << " coordY = ";
-  for  (i=4; i>=0; i--) {cout << coordY[i];} 
-  cout << " " << "\n";  
+  printf("===============================================================\n");
+  printf("-------- TRIGGER OUTPUT --------\n");
+  printf("minDevStrip = ");
+  for  (i=4; i>=0; i--) printf("%i",minDevStrip[i]);
+  printf(" minDev = ");
+  for  (i=4; i>=0; i--) printf("%i",minDev[i]);
+  printf(" coordY = ");
+  for  (i=4; i>=0; i--) printf("%i",coordY[i]); 
+  printf(" \n");
 }
 
 //----------------------------------------------------------------------