]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
In AliMUONResponseTriggerV1.h
authorivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 21 Jun 2012 10:39:54 +0000 (10:39 +0000)
committerivana <ivana@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 21 Jun 2012 10:39:54 +0000 (10:39 +0000)
**Constructor:
- Modified the argument of the constructor

**Data members:
- Deleted the 3 data members of the parametrization
- Added a TArrayF (fBValues) for the 144 bValues of the parametrization (one for each RPC side)
- Added a TArrayF (fHVvalues) for the 72 HV values
- Added an integer value (fWorkCondition) for choosing the RPCs working condition (avalanche or streaming)

**Methods:
- Deleted function SetParameters
- Added a new function for setting the b values
- Added a new function for setting the HV values
- Modified the arguments of FireStripProb (added the RPC number, the plane and the cathode)

In AliMUONResponseTriggerV1.cxx
**Constructor:
- Default c.: fWorkCondition set at 2 (i.e. avalanche)
- The HV and the b values are here initialized

**Methods:
- FireStripProb: the three parameters are set according to the HV and the working condition. The probability function is then returned
- DisIntegrate: the RPC number and plane are calculated to use the new version of FireStripProb
- Neighbours: the possibility of firing all the strip in a board is taken into account instead only 5+1 strips (minor modification)
- SetBValues: the 144 values of b parameter are set
- SetHV: the 72 values of HV are set according to OCDB. Since values chance during the run, this method returns a weighted average over the time

In AliMUON.h/.cxx
- fTriggerResponse is now an integer (0 = no cluster size; 1 = cluster size in streamer mode; 2 = cluster size in avalanche mode ).
- The argument of SetTriggerResponseV1 is now an integer
- Function GetTriggerResponseV1 gets now an integer

In AliMUONResponseFactory.cxx
- Method BuildStation6 has been modified according to the fact that now fMUON->GetTriggerResponseV1() gets an integer

(Massimiliano Marchisone)

MUON/AliMUON.cxx
MUON/AliMUON.h
MUON/AliMUONResponseFactory.cxx
MUON/AliMUONResponseTriggerV1.cxx
MUON/AliMUONResponseTriggerV1.h

index e9573254f32a7c748aa92386412f1a5636ac51d0..293c403c694d6856f5bc8e2eeb659b3bbb1de1aa 100644 (file)
@@ -100,7 +100,7 @@ AliMUON::AliMUON()
     fCurIterPad(0),
     fIsMaxStep(kTRUE),
     fTriggerScalerEvent(kFALSE),
-    fTriggerResponseV1(kFALSE),
+    fTriggerResponseV1(0),
     fTriggerCoinc44(0),
     fTriggerEffCells(kTRUE),
     fDigitizerWithNoise(1),
@@ -139,7 +139,7 @@ AliMUON::AliMUON(const char *name, const char* title)
     fCurIterPad(0),
     fIsMaxStep(kTRUE),
     fTriggerScalerEvent(kFALSE),
-    fTriggerResponseV1(kFALSE),
+    fTriggerResponseV1(0),
     fTriggerCoinc44(0),
     fTriggerEffCells(kTRUE),
     fDigitizerWithNoise(1),
@@ -608,7 +608,7 @@ AliMUON::ResetGeometryBuilder()
 }
 
 //____________________________________________________________________
-Bool_t  AliMUON::GetTriggerResponseV1() const
+Int_t  AliMUON::GetTriggerResponseV1() const
 {
 ///
 /// Returns fTriggerResponseV1
index a78db630100f89e1d90bfb82f7973328245c4515..04cd31887a45195897c8ae7d7d65cfa09b3af57c 100644 (file)
@@ -105,9 +105,9 @@ class AliMUON : public  AliDetector
     virtual void  SetTriggerScalerEvent(Bool_t scaler = true){fTriggerScalerEvent = scaler;}
 
                   /// Set trigger response version
-    virtual void  SetTriggerResponseV1(Bool_t trigResV1 = false)
+    virtual void  SetTriggerResponseV1(Int_t trigResV1 = 0)
        { fTriggerResponseV1 = trigResV1; }
-    virtual Bool_t GetTriggerResponseV1() const;
+    virtual Int_t GetTriggerResponseV1() const;
                   /// Set trigger coinc44
     virtual void  SetTriggerCoinc44(Int_t trigCoinc44 = 0)
        { fTriggerCoinc44 = trigCoinc44; }
@@ -177,7 +177,7 @@ class AliMUON : public  AliDetector
     // Options
     Bool_t fIsMaxStep;          ///< Flag to inactivate calls to gMC->SetMaxStep
     Bool_t fTriggerScalerEvent; ///< Flag to generates scaler event
-    Bool_t fTriggerResponseV1;  ///< Flag to select TriggerResponseV1
+    Int_t  fTriggerResponseV1;  ///< Flag to select TriggerResponseV1 (for cluster size in MTR)
     Int_t  fTriggerCoinc44;     ///< Flag to select TriggerCoinc44 
     Bool_t fTriggerEffCells;    ///< Flag to select TriggerEffCells
     Int_t  fDigitizerWithNoise; ///< Flag to switch on/off generation of noisy digits
index c9f8979192654f4e5f615b9f7ee3eca3a68db140..0e79a7a06bd4d0b7fb444dbf17521a0166e33c96 100644 (file)
@@ -171,20 +171,22 @@ void AliMUONResponseFactory::BuildStation6()
 {
 /// Configuration for Trigger Chambers   (Station 6,7) ---------           
 
-    Bool_t resTrigV1 = fMUON->GetTriggerResponseV1();    
+    Int_t resTrigV1 = fMUON->GetTriggerResponseV1();    
 
     for (Int_t chamber = 10; chamber < 14; chamber++) 
     {
       AliMUONResponse* response;
-      if (!resTrigV1) 
+      if(resTrigV1==1 || resTrigV1==2) //cluster size ON
       {
-        response = new AliMUONResponseTrigger;
+       response = new AliMUONResponseTriggerV1(resTrigV1); //1=STREAMER - 2=AVALANCHE
       }
-      else
+      
+      else // default: clustrer size OFF
       {
-        response = new AliMUONResponseTriggerV1;
+       response = new AliMUONResponseTrigger;
       }
-           fMUON->SetResponseModel(chamber,*response); 
+      
+      fMUON->SetResponseModel(chamber,*response);      
       fMUON->Chamber(chamber).SetChargeCorrel(0); // same charge on both cathodes
       delete response;
     }
index 15cc735911bf8130f57933bf0143c2af24302a89..4785b969e1cda22a514b26482dad6bf2fba56388 100644 (file)
 #include "AliMUONGeometryTransformer.h"
 #include "AliMUONConstants.h"
 
+#include "AliCDBManager.h"
+#include "AliCDBPath.h"
+#include "AliCDBEntry.h"
+
 #include "AliMpPad.h"
 #include "AliMpSegmentation.h"
 #include "AliMpVSegmentation.h"
 #include "AliMpCathodType.h"
 
 #include "AliRun.h"
+#include "AliDCSValue.h"
 
 #include <TMath.h>
 #include <TRandom.h>
+#include <TMap.h>
 
 /// \cond CLASSIMP
 ClassImp(AliMUONResponseTriggerV1)
@@ -49,8 +55,7 @@ namespace
     return static_cast<AliMUON*>(gAlice->GetModule("MUON"));
   }
 
-  void Global2Local(Int_t detElemId, Double_t xg, Double_t yg, Double_t zg,
-                  Double_t& xl, Double_t& yl, Double_t& zl)
+  void Global2Local(Int_t detElemId, Double_t xg, Double_t yg, Double_t zg, Double_t& xl, Double_t& yl, Double_t& zl)
   {  
   // ideally should be : 
   // Double_t x,y,z;
@@ -63,83 +68,78 @@ namespace
   }
 
 }
+                               
 
 //------------------------------------------------------------------   
-AliMUONResponseTriggerV1::AliMUONResponseTriggerV1()
-    : AliMUONResponseTrigger(),
-      fGenerCluster(0),
-      fA(0),
-      fB(0),       
-      fC(0)
-{
-/// default constructor 
-  Float_t hv=9.2;
-  SetParameters(hv);
+AliMUONResponseTriggerV1::AliMUONResponseTriggerV1() : AliMUONResponseTrigger(), fGenerCluster(0), fWorkCondition(2)
+{  
+  fHVvalues.Set(72);
+  SetHV();
+  
+  fBValues.Set(144);
+  SetBValues();
 }
 
 //------------------------------------------------------------------   
-AliMUONResponseTriggerV1::AliMUONResponseTriggerV1(Float_t hv)
-    : AliMUONResponseTrigger(),
-      fGenerCluster(0),
-      fA(0),
-      fB(0),       
-      fC(0)
+AliMUONResponseTriggerV1::AliMUONResponseTriggerV1(Int_t mode) : AliMUONResponseTrigger(), fGenerCluster(0)
 {
-/// Constructor 
-  SetParameters(hv);
+  fWorkCondition = mode; // 1=streamer - 2=avalanche
+  
+  fHVvalues.Set(72);
+  SetHV();
+  
+  fBValues.Set(144);
+  SetBValues();
 }
 
 //------------------------------------------------------------------   
 AliMUONResponseTriggerV1::~AliMUONResponseTriggerV1()
 {
-/// destructor 
-}
-
-//------------------------------------------------------------------   
-void AliMUONResponseTriggerV1::SetParameters(Float_t hv)
-{
-/// initialize parameters accoring to HV
-/// (see V.Barret B.Espagnon and P.Rosnet Alice/note xxx)
-/// this parametrisation is valid only for the "streamer" mode
-  fA = 6.089 * hv - 52.70;
-  fB = 2.966;
-  fC = 4.3e-4 * hv - 3.5e-3;
 }
 
 //------------------------------------------------------------------   
 Int_t AliMUONResponseTriggerV1::SetGenerCluster()
 {
-/// Set the GenerCluster parameter and return 1
+  // Set the GenerCluster parameter and return 1
   fGenerCluster = gRandom->Rndm();
   return 1;
 }
 
 //------------------------------------------------------------------   
-Float_t AliMUONResponseTriggerV1::FireStripProb(Float_t x4, Float_t theta)
-const
+Float_t AliMUONResponseTriggerV1::FireStripProb(Float_t x4,Float_t theta,Int_t rpc,Int_t plane,Int_t cath) const
 {
 /// parametrisation of the probability that a strip neighbour of the main 
-/// strip is fired (V.Barret B.Espagnon and P.Rosnet INT/DIM/01-04 (2001)
+/// strip is fired
 /// WARNING : need to convert x4 from cm to mm
-/// this parametrisation is valid only for the "streamer" mode
 
- return 
-     (TMath::Cos(theta)*fA/(fA+TMath::Cos(theta)*TMath::Power(x4*10.,fB))+fC)/
-     (TMath::Cos(theta)+fC);
+  Float_t hv = fHVvalues.At(18*plane+rpc);
+  Float_t parA, parB, parC;
+  
+  if(fWorkCondition == 2) //avalanche
+    parB = fBValues.At(72*cath+18*plane+rpc);
+  else //streamer
+    parB = 2.966;
+  
+  
+  parA = 6.089 * hv - 52.70;
+  parC = 8.3e-4 * hv - 0.5e-3;  
+
+ return (TMath::Cos(theta)*parA/(parA+TMath::Cos(theta)*TMath::Power(x4*10.,parB))+parC)/(TMath::Cos(theta)+parC);
 }
 
-//------------------------------------------------------------------  
+//------------------------------------------------------------------
 void AliMUONResponseTriggerV1::DisIntegrate(const AliMUONHit& hit, TList& digits, Float_t /*timeDif*/)
 {
-  /// Generate digits (on each cathode) from 1 hit, with cluster-size
-  /// generation.
+  /// Generate digits (on each cathode) from 1 hit, with cluster-size generation.
   
   digits.Clear();
   
   Float_t xhit = hit.X();
   Float_t yhit = hit.Y();
   Float_t zhit = hit.Z();
-  Int_t detElemId = hit.DetElemId();  
+  Int_t detElemId = hit.DetElemId();
+  Int_t plane = detElemId/100 - 11; //plane from 0 to 3
+  Int_t rpc = detElemId%100; //rpc from 0 to 3
   
   Double_t x,y,z;
   Global2Local(detElemId,xhit,yhit,zhit,x,y,z);
@@ -151,27 +151,22 @@ void AliMUONResponseTriggerV1::DisIntegrate(const AliMUONHit& hit, TList& digits
     twentyNano=1;
   }
   
+  
   Int_t nboard = 0;
 
-  for ( Int_t cath = AliMp::kCath0; cath <= AliMp::kCath1; ++cath )
+  for(Int_t cath = AliMp::kCath0; cath <= AliMp::kCath1; ++cath)
   {
-    const AliMpVSegmentation* seg 
-      = AliMpSegmentation::Instance()
-        ->GetMpSegmentation(detElemId,AliMp::GetCathodType(cath));
-
+    const AliMpVSegmentation* seg = AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,AliMp::GetCathodType(cath));
+    
     AliMpPad pad = seg->PadByPosition(x,y,kFALSE);
     Int_t ix = pad.GetIx();
     Int_t iy = pad.GetIy();
     
-    AliDebug(1,Form("xhit,yhit=%e,%e lx,ly,lz=%e,%e,%e ix,iy=%d,%d",
-                    xhit,yhit,x,y,z,ix,iy));
+    AliDebug(1,Form("xhit,yhit=%e,%e lx,ly,lz=%e,%e,%e ix,iy=%d,%d",xhit,yhit,x,y,z,ix,iy));
     
     if ( !pad.IsValid() )
     {
-      AliWarning(Form("hit w/o strip %d-%d xhit,yhit=%e,%e local x,y,z "
-                      "%e,%e,%e ix,iy=%d,%d",detElemId,
-                      cath,
-                      xhit,yhit,x,y,z,ix,iy));
+      AliWarning(Form("hit w/o strip %d-%d xhit,yhit=%e,%e local x,y,z ""%e,%e,%e ix,iy=%d,%d",detElemId,cath,xhit,yhit,x,y,z,ix,iy));
       continue;
     }
     
@@ -180,123 +175,203 @@ void AliMUONResponseTriggerV1::DisIntegrate(const AliMUONHit& hit, TList& digits
     AliMUONDigit* d = new AliMUONDigit(detElemId,nboard,
                                        pad.GetLocalBoardChannel(0),
                                        cath);
+    
     d->SetPadXY(ix,iy);
-
     d->SetCharge(twentyNano);
-
-
+    
     digits.Add(d);
-
+    
     SetGenerCluster(); // 1 randum number per cathode (to be checked)
-
-    Int_t xList[10], yList[10];
+    
+    Int_t xList[30], yList[30];
     Neighbours(cath,ix,iy,xList,yList);
     
-//    cout << " detElemId cath ix iy = " << detElemId << " " << cath 
-//      << " " << ix << " " << iy << "\n";
-//    for (Int_t i=0; i<10; i++) cout << " " << xList[i] << " " << yList[i];
-//    cout << "\n";
-
+    
     Int_t qp = 0; // fired/no-fired strip = 1/0
-    for (Int_t i=0; i<10; i++) { // loop on neighbors
-       if (i==0||i==5||qp!=0) { // built-up cluster
-           
-           // need to iterate in iy/ix for bending/non-bending plane
-           Int_t ixNeigh = ( cath == 0 ) ? ix : xList[i];
-           Int_t iyNeigh = ( cath == 0 ) ? yList[i] : iy;
-           
-           AliMpPad padNeigh = seg->PadByIndices(ixNeigh,iyNeigh,kFALSE);
-           if(padNeigh.IsValid()){ // existing neighbourg              
-               
-               Int_t dix=-(ixNeigh-ix);
-               Int_t diy=-(iyNeigh-iy);
-               Float_t xlocalNeigh = padNeigh.GetPositionX();
-               Float_t ylocalNeigh = padNeigh.GetPositionY();
-               Float_t dpx = padNeigh.GetDimensionX();
-               Float_t dpy = padNeigh.GetDimensionY();
-               Float_t distX = TMath::Abs((Float_t)dix) * ((Float_t)dix * dpx + xlocalNeigh - x);
-               Float_t distY = TMath::Abs((Float_t)diy) * ((Float_t)diy * dpy + ylocalNeigh - y);
-               Float_t dist = TMath::Sqrt(distX*distX+distY*distY);
-               
-//             cout << " here " << dist << " " << fGenerCluster << " " << FireStripProb(dist,0) << "\n";
+    for (Int_t i=0; i<30; i++)  // loop on neighbors
+    {
+      if (i==0 || i==15 || qp!=0) // built-up cluster // need to iterate in iy/ix for bending/non-bending plane
+      {
+       Int_t ixNeigh = (cath == 0) ? ix : xList[i];
+       Int_t iyNeigh = (cath == 0) ? yList[i] : iy;
+       
+       AliMpPad padNeigh = seg->PadByIndices(ixNeigh,iyNeigh,kFALSE);
+       if(padNeigh.IsValid()) // existing neighbourg
+       {
+         Int_t dix=-(ixNeigh-ix);
+         Int_t diy=-(iyNeigh-iy);
+         Float_t xlocalNeigh = padNeigh.GetPositionX();
+         Float_t ylocalNeigh = padNeigh.GetPositionY();
+         Float_t dpx = padNeigh.GetDimensionX();
+         Float_t dpy = padNeigh.GetDimensionY();
+         Float_t distX = TMath::Abs((Float_t)dix) * ((Float_t)dix * dpx + xlocalNeigh - x);
+         Float_t distY = TMath::Abs((Float_t)diy) * ((Float_t)diy * dpy + ylocalNeigh - y);
+         Float_t dist = TMath::Sqrt(distX*distX+distY*distY);
                
-               if (fGenerCluster<FireStripProb(dist,0)) qp = 1;
-               else qp = 0;
+         if(fGenerCluster < FireStripProb(dist,0,rpc,plane,cath))
+           qp = 1;
+         else
+           qp = 0;
                
-               if (qp == 1) { // this digit is fired    
-        Int_t neighBoard = 0;
-        if ( cath == AliMp::kCath0 ) neighBoard = padNeigh.GetLocalBoardId(0);
-        else {
-          const AliMpVSegmentation* seg0 
-            = AliMpSegmentation::Instance()
-              ->GetMpSegmentation(detElemId,AliMp::GetCathodType(AliMp::kCath0));
-          AliMpPad padNeigh0 = seg0->PadByPosition(xlocalNeigh, y, kFALSE);
-          if ( ! padNeigh0.IsValid() ) continue; // This can happen only on the cut RPC, at boards 25, 30, 142 and 147
-          neighBoard = padNeigh0.GetLocalBoardId(0);
-        }
-                   AliMUONDigit* dNeigh = new AliMUONDigit(detElemId,neighBoard,
-                                                padNeigh.GetLocalBoardChannel(0),
-                                                cath);
-                   
-                   dNeigh->SetPadXY(ixNeigh,iyNeigh);      
-                   dNeigh->SetCharge(twentyNano);
-                   digits.Add(dNeigh);
-               } // digit fired                
-           } // pad is valid
-       } // built-up cluster
+         if(qp == 1)
+         { // this digit is fired    
+           AliMUONDigit* dNeigh = new AliMUONDigit(detElemId,padNeigh.GetLocalBoardId(0),padNeigh.GetLocalBoardChannel(0),cath);
+           
+           dNeigh->SetPadXY(ixNeigh,iyNeigh);      
+           dNeigh->SetCharge(twentyNano);
+           digits.Add(dNeigh);
+         } // digit fired
+       } // pad is valid
+      } // built-up cluster
     } // loop on neighbors
   } // loop on cathode
 }
 
-//------------------------------------------------------------------  
-void AliMUONResponseTriggerV1::Neighbours(const Int_t cath, 
-                                         const Int_t ix, const Int_t iy, 
-                                         Int_t Xlist[10], Int_t Ylist[10]) const
+//------------------------------------------------------------------
+void AliMUONResponseTriggerV1::SetHV()
 {
-    ///-----------------BENDING-----------------------------------------      /n
-    /// Returns list of 10 next neighbours for given X strip (ix, iy)         /n
-    /// neighbour number 4 in the list -                                      /n    
-    /// neighbour number 3 in the list  |                                     /n   
-    /// neighbour number 2 in the list  |_ Upper part                         /n         
-    /// neighbour number 1 in the list  |                                     /n    
-    /// neighbour number 0 in the list -                                      /n   
-    ///      X strip (ix, iy)                                                 /n
-    /// neighbour number 5 in the list -                                      /n
-    /// neighbour number 6 in the list  | _ Lower part                        /n
-    /// neighbour number 7 in the list  |                                     /n
-    /// neighbour number 8 in the list  |                                     /n
-    /// neighbour number 9 in the list -                                      /n
-    ///                                                                       /n
-    ///-----------------NON-BENDING-------------------------------------      /n
-    /// Returns list of 10 next neighbours for given Y strip (ix, iy)         /n 
-    /// neighbour number 9 8 7 6 5 (Y strip (ix, iy)) 0 1 2 3 4 in the list   /n 
-    ///                  |_______|                    |_______/               /n 
-
-    ///                    left                         right                 /n
+  TString side;
+  Int_t newRPC=0,newPlane=0;
+  
+  AliCDBManager *manager = AliCDBManager::Instance();
+  AliCDBPath path("MUON/Calib/TriggerDCS");
+  AliCDBEntry *entry = manager->Get(path);
+  TMap *hvMap = dynamic_cast<TMap*>(entry->GetObject());
+  TObjArray *objArr = 0x0;
+  
+  AliDCSValue *dcsValue = 0x0;
+  UInt_t time1,time2,timebegin,timeend;
+  Int_t nEntries;
+  Float_t voltage = 0;
+  
+  for(Int_t iPlane=0; iPlane<4; iPlane++) //loop on MT
+  {
+    for(Int_t iRPC=0; iRPC<18; iRPC++) //loop on RPC
+    {
+      if(iRPC>=5 && iRPC<=13)
+      {
+        side = "OUTSIDE";
+        newRPC = 14-iRPC;
+      }
+  
+      else
+      {
+        side = "INSIDE";
     
-    for (Int_t i=0; i<10; i++) {
-       Xlist[i]=-1;
-       Ylist[i]=-1;
-    }
+        if(iRPC>=14)
+          newRPC = iRPC-13;
+        else
+          newRPC = iRPC+5;
+      }
+  
+      switch(iPlane)
+      {
+        case 0: newPlane = 11; break;
+        case 1: newPlane = 12; break;
+        case 2: newPlane = 21; break;
+        case 3: newPlane = 22; break;
+      }
+  
+      objArr = (TObjArray*)hvMap->GetValue(Form("MTR_%s_MT%d_RPC%d_HV.vEff",side.Data(),newPlane,newRPC));
+      nEntries = objArr->GetEntries();
+       
+      for(Int_t i=0; i<nEntries-1; i++)
+      {          
+        dcsValue = (AliDCSValue*)objArr->At(i+1);
+        time2 = dcsValue->GetTimeStamp();
     
-    Int_t iList[10]={9,8,7,6,5, 0,1,2,3,4};
+        if(i==nEntries-2)
+          timeend = time2;
+    
+        dcsValue = (AliDCSValue*)objArr->At(i);
+          time1 = dcsValue->GetTimeStamp();
+    
+        if(i==0)
+          timebegin = time1;
+    
+        voltage += (dcsValue->GetFloat())*(time2-time1);
+      }
+      
+      fHVvalues.AddAt(voltage/(timeend-timebegin)/1000,18*iPlane+iRPC); //voltage in kV, not in V
+      
+      voltage=0;
+    }
+  }
+}
 
-    // need to iterate in iy/ix for bending/non-bending plane
-    Int_t iNeigh = ( cath == 0 ) ? iy : ix;
+//------------------------------------------------------------------  
+void AliMUONResponseTriggerV1::SetBValues()
+{
+  Float_t bValues[2][4][18] =                                                                                                                        {{{1.97,2.47,2.47,2.47,2.97,2.97,2.47,2.47,1.97,2.22,1.97,2.47,1.97,2.97,2.97,2.47,2.47,1.97},  //MT11BP
+    {2.22,2.22,1.97,2.47,2.97,2.97,1.97,2.47,1.97,1.97,1.97,2.47,1.97,2.97,2.97,1.97,1.97,1.97},  //MT12BP
+    {2.22,2.22,2.47,2.47,2.97,2.97,2.47,2.47,2.22,1.97,1.97,2.47,1.97,2.97,2.97,1.97,1.97,1.97},  //MT21BP
+    {1.97,1.97,2.97,2.97,2.97,2.97,2.47,1.97,1.97,1.97,1.72,2.47,2.22,2.97,2.97,1.97,1.97,1.97}}, //MT22BP
+   {{1.97,2.47,2.47,2.97,2.97,2.97,2.97,2.47,1.97,1.97,2.22,2.47,2.97,2.97,2.97,2.97,1.97,1.72},  //MT11NBP
+    {2.47,1.97,2.22,2.97,2.97,2.97,2.47,2.97,1.97,1.97,1.97,2.97,2.97,2.97,2.97,2.97,1.97,1.97},  //MT12NBP
+    {1.97,2.47,2.47,2.97,2.97,2.97,2.97,2.47,2.22,1.97,2.22,2.47,2.97,2.97,2.97,2.47,1.97,1.97},  //MT21NBP
+    {1.72,1.97,2.97,2.97,2.97,2.97,2.97,1.97,1.72,2.22,1.97,2.47,2.97,2.47,2.97,1.97,1.97,1.97}}};//MT22NBP
+                                
+  for(Int_t iCath=0; iCath<2; iCath++) //loop on side
+  {
+    for(Int_t iPlane=0; iPlane<4; iPlane++) //loop on MT
+    {
+      for(Int_t iRPC=0; iRPC<18; iRPC++) //loop on RPC
+      {
+       fBValues.AddAt(bValues[iCath][iPlane][iRPC],72*iCath+18*iPlane+iRPC);
+      }
+    }
+  }
+}
+
+//------------------------------------------------------------------  
+void AliMUONResponseTriggerV1::Neighbours(const Int_t cath, const Int_t ix, const Int_t iy, Int_t Xlist[30], Int_t Ylist[30]) const
+{
+  ///-----------------BENDING-----------------------------------------      /n
+  /// Returns list of 30 next neighbours for given X strip (ix, iy)         /n
+  /// neighbour number 4 in the list -                                      /n    
+  /// neighbour number 3 in the list  |                                     /n   
+  /// neighbour number 2 in the list  |_ Upper part                         /n         
+  /// neighbour number 1 in the list  |                                     /n    
+  /// neighbour number 0 in the list -                                      /n   
+  ///      X strip (ix, iy)                                                 /n
+  /// neighbour number 5 in the list -                                      /n
+  /// neighbour number 6 in the list  | _ Lower part                        /n
+  /// neighbour number 7 in the list  |                                     /n
+  /// neighbour number 8 in the list  |                                     /n
+  /// neighbour number 9 in the list -                                      /n
+  ///                                                                       /n
+  ///-----------------NON-BENDING-------------------------------------      /n
+  /// Returns list of 30 next neighbours for given Y strip (ix, iy)         /n 
+  /// neighbour number 9 8 7 6 5 (Y strip (ix, iy)) 0 1 2 3 4 in the list   /n 
+  ///                  |_______|                    |_______|               /n 
+  ///                    left                         right                 /n
+  
+  for (Int_t i=0; i<30; i++)
+  {
+    Xlist[i] = -1;
+    Ylist[i] = -1;
+  }
+  
+  Int_t iList[30]={29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14};
+  
+  // need to iterate in iy/ix for bending/non-bending plane
+  Int_t iNeigh = (cath == 0) ? iy : ix;
     
-    Int_t i=0;
-    for (Int_t j=iNeigh-5; j<=iNeigh+5; j++){
-       if (j == iNeigh) continue;
-       // need to iterate in iy/ix for bending/non-bending plane
-       Int_t ixNeigh = ( cath == 0 ) ? ix : j;
-       Int_t iyNeigh = ( cath == 0 ) ? j : iy;
+  Int_t i=0;
+  for (Int_t j=iNeigh-15; j<=iNeigh+15; j++)
+  {
+    if (j == iNeigh)
+      continue;
+       
+    // need to iterate in iy/ix for bending/non-bending plane
+    Int_t ixNeigh = ( cath == 0 ) ? ix : j;
+    Int_t iyNeigh = ( cath == 0 ) ? j : iy;
        
 //     cout << " " << cath << " " << ix << " " << iy 
 //          << " "  << ixNeigh << " " << iyNeigh << "\n";
        
-       Xlist[iList[i]]=ixNeigh;        
-       Ylist[iList[i]]=iyNeigh;        
-       i++;
-    
+    Xlist[iList[i]]=ixNeigh;   
+    Ylist[iList[i]]=iyNeigh;   
+    i++;
+  } 
 }
-
index 74761bed9dbec3083e97b55556a26a1f4d50dfe9..bb5914e5e5fba4ad127412e3abb34489bf73b473 100644 (file)
 
 #include "AliMUONResponseTrigger.h"
 #include "AliMUONHit.h"
+#include "TArrayF.h"
 
 class AliMUONResponseTriggerV1 : public AliMUONResponseTrigger 
 {
   public:
     // default constructor
     AliMUONResponseTriggerV1();
-    AliMUONResponseTriggerV1(Float_t hv);
+    AliMUONResponseTriggerV1(Int_t mode);
     virtual ~AliMUONResponseTriggerV1();
-
+    
     // Set the GenerCluster parameter       
     virtual Int_t SetGenerCluster();
-    
     virtual void DisIntegrate(const AliMUONHit& hit, TList& digits, Float_t timeDif);
     
   protected:
-    Float_t fGenerCluster;   ///< Random number  
-    Float_t fA;              ///< first parameter  of the cluster-size param
-    Float_t fB;              ///< second parameter of the cluster-size param
-    Float_t fC;              ///< third parameter  of the cluster-size param
+    Float_t fGenerCluster;   ///< Random number
+    TArrayF fHVvalues;       ///< Array containing HV values
+    TArrayF fBValues;        ///< Array containing b parameters
+    Int_t fWorkCondition;    ///< 1=streamer - 2=avalanche
 
   private:
-    // initialize parameters
-    void SetParameters(Float_t hv);
     // parametrization of the cluster-size
-    Float_t FireStripProb(Float_t x4, Float_t theta) const;
-    void Neighbours(const Int_t cath, const Int_t iX, const Int_t iY, Int_t Xlist[10], Int_t Ylist[10]) const;
-    
-  ClassDef(AliMUONResponseTriggerV1,1) // Implementation of RPC response
+    void SetHV();
+    void SetBValues();
+    Float_t FireStripProb(Float_t x4, Float_t theta,Int_t rpc,Int_t plane,Int_t cath) const;
+    void Neighbours(const Int_t cath, const Int_t iX, const Int_t iY, Int_t Xlist[30], Int_t Ylist[30]) const;
     
+  ClassDef(AliMUONResponseTriggerV1,2) // Implementation of RPC response
 };
 #endif
-
-
-
-
-
-
-
-
-
-
-
-
-