]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSresponseSPDdubna.cxx
Implementing of new function to check for holes (M.Ivanov)
[u/mrichter/AliRoot.git] / ITS / AliITSresponseSPDdubna.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 #include<Riostream.h>
17 #include "AliITSresponseSPDdubna.h"
18 //////////////////////////////////////////////////////
19 //  Response class for set:ITS                      //
20 //  Specific subdetector implementation for         //
21 //  Silicon pixels                                  //
22 //  This is and alternative version                 //
23 //  to the default version                          //
24 ////////////////////////////////////////////////////// 
25 const Float_t AliITSresponseSPDdubna::fgkNoiseDefault = 200.;
26 const Float_t AliITSresponseSPDdubna::fgkThresholdDefault = 2000.;
27
28 //___________________________________________
29 ClassImp(AliITSresponseSPDdubna)        
30
31 AliITSresponseSPDdubna::AliITSresponseSPDdubna() : AliITSresponse(){
32    // Default constructor
33    // Inputs:
34    //    none.
35    // Outputs:
36    //    none.
37    // Return:
38    //    A default constructed AliITSresponseSPD class
39
40    SetNoiseParam(fgkNoiseDefault,0.);  // fNoise, fBaseline
41    SetThresholds(fgkThresholdDefault,0.);   // fThreshold
42    SetCouplings();   // fCouplCol, fCouplRow
43    SetFractionDeadPixels(); // fDeadPixels
44    SetDataType();    // fDataType
45 }
46 //_________________________________________________________________________
47 Bool_t AliITSresponseSPDdubna::IsPixelDead(Int_t mod,Int_t ix,Int_t iz) const {
48   // Returns kTRUE if pixel is dead
49   // Inputs:
50   //    Int_t mod      module number
51   //    Int_t ix       x pixel number
52   //    Int_t iz       z pixel number
53   // Outputs:
54   //    none.
55   // Return:
56   //    kFALSE if pixel is alive, or kTRUE if pixel is dead.
57   Bool_t  dead = kFALSE;
58   Int_t   seed;
59   static TRandom ran; // don't use gRandom. This must not be a true randome
60   // sequence. These sequence must be random one and then fully repetable.
61
62   seed = mod*256*256+iz*256+ix;
63   ran.SetSeed(seed);
64   if(ran.Rndm(0)<fDeadPixels) dead = kTRUE;
65   return dead;
66 }
67
68 //----------------------------------------------------------------------
69 void AliITSresponseSPDdubna::Print(ostream *os) const{
70     // Standard output format for this class.
71     // Inputs:
72     //    ostream *os  Pointer to the output stream
73     // Outputs:
74     //    none:
75     // Return:
76     //    none.
77
78     AliITSresponse::Print(os);
79     *os << fNoise << " " << fBaseline << " " << fCouplCol << " ";
80     *os << fCouplRow << " "<< fThreshold << " " << fDeadPixels << " ";
81     *os << fDataType;
82 //    *os << " " << endl;
83     return;
84 }
85
86 //----------------------------------------------------------------------
87 void AliITSresponseSPDdubna::Read(istream *is) {
88     // Standard input format for this class.
89     // Inputs:
90     //    ostream *os  Pointer to the output stream
91     // Outputs:
92     //    none:
93     // Return:
94     //    none.
95
96     AliITSresponse::Read(is);
97     *is >> fNoise >> fBaseline >> fCouplCol >> fCouplRow;
98     *is >> fThreshold >> fDeadPixels >> fDataType;
99     return;
100 }
101 //----------------------------------------------------------------------
102
103 ostream &operator<<(ostream &os,AliITSresponseSPDdubna &p){
104     // Standard output streaming function.
105     // Inputs:
106     //    ostream *os  Pointer to the output stream
107     // Outputs:
108     //    none:
109     // Return:
110     //    none.
111
112     p.Print(&os);
113     return os;
114 }
115
116 //----------------------------------------------------------------------
117 istream &operator>>(istream &is,AliITSresponseSPDdubna &r){
118     // Standard input streaming function.
119     // Inputs:
120     //    ostream *os  Pointer to the output stream
121     // Outputs:
122     //    none:
123     // Return:
124     //    none.
125
126     r.Read(&is);
127     return is;
128 }
129 //----------------------------------------------------------------------
130