1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 #include <Riostream.h>
19 #include "AliITSresponseSPDdubna.h"
21 //___________________________________________
22 ClassImp(AliITSresponseSPDdubna)
24 AliITSresponseSPDdubna::AliITSresponseSPDdubna() : AliITSresponse(){
25 // Default constructor
31 // A default constructed AliITSresponseSPD class
33 SetNoiseParam(); // fNoise, fBaseline
34 SetThreshold(); // fThreshold
35 SetCouplings(); // fCouplCol, fCouplRow
36 SetFractionDeadPixels(); // fDeadPixels
37 SetDataType(); // fDataType
39 //_________________________________________________________________________
40 Bool_t AliITSresponseSPDdubna::IsPixelDead(Int_t mod,Int_t ix,Int_t iz) const {
41 // Returns kTRUE if pixel is dead
43 // Int_t mod module number
44 // Int_t ix x pixel number
45 // Int_t iz z pixel number
49 // kFALSE if pixel is alive, or kTRUE if pixel is dead.
52 static TRandom ran; // don't use gRandom. This must not be a true randome
53 // sequence. These sequence must be random one and then fully repetable.
55 seed = mod*256*256+iz*256+ix;
57 if(ran.Rndm(0)<fDeadPixels) dead = kTRUE;
60 //----------------------------------------------------------------------
61 void AliITSresponseSPDdubna::Print(ostream *os){
62 // Standard output format for this class.
64 // ostream *os Pointer to the output stream
76 #if defined __ICC || defined __ECC
83 AliITSresponse::Print(os);
84 fmt = os->setf(ios::scientific); // set scientific floating point output
85 *os << fNoise << " " << fBaseline << " " << fCouplCol << " ";
86 *os << fCouplRow << " "<< fThreshold << " " << fDeadPixels << " ";
88 // *os << " " << endl;
89 os->flags(fmt); // reset back to old formating.
92 //----------------------------------------------------------------------
93 void AliITSresponseSPDdubna::Read(istream *is){
94 // Standard input format for this class.
96 // ostream *os Pointer to the output stream
102 AliITSresponseSPDdubna::Read(is);
103 *is >> fNoise >> fBaseline >> fCouplCol >> fCouplRow;
104 *is >> fThreshold >> fDeadPixels >> fDataType;
107 //----------------------------------------------------------------------
108 ostream &operator<<(ostream &os,AliITSresponseSPDdubna &p){
109 // Standard output streaming function.
111 // ostream *os Pointer to the output stream
120 //----------------------------------------------------------------------
121 istream &operator>>(istream &is,AliITSresponseSPDdubna &r){
122 // Standard input streaming function.
124 // ostream *os Pointer to the output stream
133 //----------------------------------------------------------------------