]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONResponseTriggerV1.cxx
Added get functions to access mapping.
[u/mrichter/AliRoot.git] / MUON / AliMUONResponseTriggerV1.cxx
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 /* $Id$ */
17
18 #include <TMath.h>
19 #include <TRandom.h>
20
21 #include "AliMUONResponseTriggerV1.h"
22 #include "AliSegmentation.h"
23 #include "AliMUONGeometrySegmentation.h"
24
25 ClassImp(AliMUONResponseTriggerV1)
26
27 //------------------------------------------------------------------   
28 AliMUONResponseTriggerV1::AliMUONResponseTriggerV1()
29   : AliMUONResponseTrigger() 
30 {
31 // default constructor 
32   Float_t hv=9.2;
33   SetParameters(hv);
34 }
35
36 //------------------------------------------------------------------   
37 AliMUONResponseTriggerV1::AliMUONResponseTriggerV1(Float_t hv)
38   : AliMUONResponseTrigger() 
39 {
40 // Constructor 
41   SetParameters(hv);
42 }
43
44 //------------------------------------------------------------------   
45 void AliMUONResponseTriggerV1::SetParameters(Float_t hv){
46 // initialize parameters accoring to HV
47 // (see V.Barret B.Espagnon and P.Rosnet Alice/note xxx)
48   fA = 6.089 * hv - 52.70;
49   fB = 2.966;
50   fC = 4.3e-4 * hv - 3.5e-3;
51 }
52
53 //------------------------------------------------------------------   
54 Int_t AliMUONResponseTriggerV1::SetGenerCluster(){
55 // Set the GenerCluster parameter and return 1
56   fGenerCluster = gRandom->Rndm();
57   return 1;
58
59
60 //------------------------------------------------------------------   
61 Float_t AliMUONResponseTriggerV1::IntXY(AliSegmentation * segmentation){
62 // Returns 1 or 0 if the current strip is fired or not 
63 // get the "parameters" needed to evaluate the strip response
64 // x1 : hit x(y) position
65 // x2 : x(y) coordinate of the main strip
66 // x3 : current strip real x(y) coordinate  
67 // x4 : dist. between x(y) hit pos. and the closest border of the current strip
68
69   Float_t x1,x2,x3,x4;  
70   segmentation->IntegrationLimits(x1,x2,x3,x4);    
71   Float_t theta = 0.; // incident angle to be implemented
72
73   return (fGenerCluster < FireStripProb(x4,theta)) ? 1:0; 
74 }
75 //------------------------------------------------------------------   
76 Float_t AliMUONResponseTriggerV1::IntXY(Int_t idDE, AliMUONGeometrySegmentation * segmentation){
77 // Returns 1 or 0 if the current strip is fired or not 
78 // get the "parameters" needed to evaluate the strip response
79 // x1 : hit x(y) position
80 // x2 : x(y) coordinate of the main strip
81 // x3 : current strip real x(y) coordinate  
82 // x4 : dist. between x(y) hit pos. and the closest border of the current strip
83
84   Float_t x1,x2,x3,x4;  
85   segmentation->IntegrationLimits(idDE, x1,x2,x3,x4);    
86   Float_t theta = 0.; // incident angle to be implemented
87
88   return (fGenerCluster < FireStripProb(x4,theta)) ? 1:0; 
89 }
90
91 //------------------------------------------------------------------   
92 Float_t AliMUONResponseTriggerV1::FireStripProb(Float_t x4, Float_t theta){
93 // parametrisation of the probability that a strip neighbour of the main 
94 // strip is fired (V.Barret B.Espagnon and P.Rosnet Alice/note xxx)
95 // WARNING : need to convert x4 from cm to mm
96
97   return 
98     (TMath::Cos(theta)*fA/(fA+TMath::Cos(theta)*TMath::Power(x4*10.,fB))+fC)/
99     (TMath::Cos(theta)+fC);
100 }
101