]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSPlaneEffSSD.h
ECS run type is PEDESTAL and not PEDESTAL_RUN
[u/mrichter/AliRoot.git] / ITS / AliITSPlaneEffSSD.h
CommitLineData
6344adcc 1#ifndef ALIITSPLANEEFFSSD_H
2#define ALIITSPLANEEFFSSD_H
3/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
3ebe30ad 6#include <TH1F.h>
7#include <TH2I.h>
6344adcc 8#include "AliITSPlaneEff.h"
1cc5cedc 9#include "AliCDBId.h"
6344adcc 10
11///////////////////////////////////////////
12// //
13// ITS Plane Efficiency class //
14// for SSD //
15// Origin: Giuseppe.Bruno@ba.infn.it //
16///////////////////////////////////////////
17
18/* $Id$ */
19
20class AliITSPlaneEffSSD : public AliITSPlaneEff {
21 public:
22 AliITSPlaneEffSSD(); // default constructor
23 virtual ~AliITSPlaneEffSSD(); // destructror
24 // copy constructor
25 AliITSPlaneEffSSD(const AliITSPlaneEffSSD &source);
26 // ass. operator
27 AliITSPlaneEffSSD& operator=(const AliITSPlaneEffSSD &s);
28 virtual AliITSPlaneEff& operator=(const AliITSPlaneEff &source);
29 // Simple way to add another class (i.e. statistics).
30 AliITSPlaneEffSSD& operator +=( const AliITSPlaneEffSSD &add);
31 // Getters for average Plane efficiency (icluding dead/noisy)
32 Double_t PlaneEff(const UInt_t mod) const;
33 Double_t ErrPlaneEff(const UInt_t mod) const;
34 // Methods to update the Plane efficiency (specific of the SSD segmentation)
35 Bool_t UpDatePlaneEff(const Bool_t Kfound, const UInt_t mod);
36 //
37 enum {kNModule = 1698}; // The number of modules
38 enum {kNChip = 6}; // The number of chips per side of a module (2 sides: 12 chips)
39 enum {kNSide = 2}; // The number of sides of a module (p and n side)
40 enum {kNStrip = 128}; // The number of strips per chip (in a module 2*768 strips)
41//
6344adcc 42// Plane efficiency for active detector (excluding dead/noisy channels)
43// access to DB is needed
44 virtual Double_t LivePlaneEff(UInt_t mod) const;
45 virtual Double_t ErrLivePlaneEff(UInt_t mod) const;
46 // Compute the fraction of Live area (of the module for the SSD)
47 virtual Double_t GetFracLive(const UInt_t mod) const;
48 // Compute the fraction of bad (i.e. dead and noisy) area (of the module for the SSD)
49 virtual Double_t GetFracBad(const UInt_t mod) const;
50 virtual Bool_t WriteIntoCDB() const;
51 virtual Bool_t ReadFromCDB(); // this method reads Data Members (statistics) from DataBase
1cc5cedc 52 Bool_t AddFromCDB(AliCDBId *cdbId); // this method updates Data Members (statistics) from DataBase
53 virtual Bool_t AddFromCDB() {AliCDBId *cdbId=0; return AddFromCDB(cdbId);}
7167ae53 54 // method to locate a basic block from Detector Local coordinate (to be used in tracking)
55 // see file cxx for numbering convention.
56 // here idet runs from 0 to 747 for layer 4 and from 0 to 949 for layer 5
57 UInt_t GetKeyFromDetLocCoord(Int_t ilay,Int_t idet, Float_t, Float_t locz) const;
58 UInt_t Nblock() const; // return the number of basic blocks
aa0de373 59 // compute the geometrical limit of a basic block (chip) in detector local coordinate system
60 Bool_t GetBlockBoundaries(const UInt_t key,Float_t& xmn,Float_t& xmx,Float_t& zmn,Float_t& zmx) const;
3ebe30ad 61 // Methods for dealing with auxiliary histograms
62 // method to set on/off the creation/updates of histograms (Histos are created/destroyed)
1cc5cedc 63 virtual void SetCreateHistos(Bool_t his=kFALSE)
3ebe30ad 64 {fHis=his; if(fHis) {DeleteHistos(); InitHistos();} else DeleteHistos(); return; }
1cc5cedc 65 //Bool_t FillHistos(UInt_t key, Bool_t found, Float_t trackXZ[2], Float_t clusterXZ[2], Int_t ctXZ[2]);
66 virtual Bool_t FillHistos(UInt_t key, Bool_t found, Float_t *track, Float_t *cluster, Int_t *ctype);
67 virtual Bool_t WriteHistosToFile(TString filename="PlaneEffSSDHistos.root",Option_t* option = "RECREATE");
68 virtual Bool_t ReadHistosFromFile(TString filename="PlaneEffSSDHistos.root"); // histos must exist already !
3ebe30ad 69 // This method increases the
70 // statistics of histos by adding
71 // those of the input file.
1cc5cedc 72 UInt_t GetKey(const UInt_t mod) const; // unique key to locate the basic
73 // block of the SSD (the module itself)
6344adcc 74 protected:
75 virtual void Copy(TObject &obj) const;
76 Int_t GetMissingTracksForGivenEff(Double_t eff, Double_t RelErr, UInt_t im) const;
1cc5cedc 77 UInt_t GetModFromKey(const UInt_t key) const;
78 void GetBadInModule(const UInt_t mod, UInt_t& bad) const;
6344adcc 79
80//
81 Int_t fFound[kNModule]; // number of associated clusters in a given module
82 Int_t fTried[kNModule]; // number of tracks used for module efficiency evaluation
1cc5cedc 83//
84 private:
85 enum {kNHisto = kNModule}; // The number of histograms: module by module.
86 //enum {kNclu = 3}; // Build specific histos of residuals up to cluster size kNclu.
87 // If you change them, then you must change implementation of
88 // the method FillHistos.
89 virtual void InitHistos(); // create histos by allocating memory for them
90 virtual void DeleteHistos(); // deletete histos (memory is freed)
91 void CopyHistos(AliITSPlaneEffSSD& target) const; // copy only histograms to target
3ebe30ad 92//
93 TH1F **fHisResX; //! histos with residual distribution (track-cluster) along local X (r-phi)
94 TH1F **fHisResZ; //! histos with residual distribution (track-cluster) along local Z
95 TH2F **fHisResXZ; //! 2-d histos with residual distribution (track-cluster) along local X and Z
96 TH2I **fHisClusterSize; //! histos with cluster-size distribution
1cc5cedc 97//
3ebe30ad 98 ClassDef(AliITSPlaneEffSSD,2) // SSD Plane Efficiency class
6344adcc 99};
7167ae53 100//
101inline UInt_t AliITSPlaneEffSSD::Nblock() const {return kNModule;}
aa0de373 102inline Bool_t AliITSPlaneEffSSD::GetBlockBoundaries(const UInt_t key,Float_t& xmn,Float_t& xmx,
103 Float_t& zmn,Float_t& zmx) const {
104// This method return the geometrical boundaries of the active volume of a given
105// basic block, in the detector reference system.
106//
107if(key>=kNModule)
108 {AliWarning("GetBlockBoundaries: you asked for a non existing key"); return kFALSE;}
109const Float_t kDxDefault = 72960.; // For Plane Eff. purpouses, default values
110const Float_t kDzDefault = 40000.; // are precise enough !!!
111const Float_t kconv = 1.0E-04; //converts microns to cm.
112xmn=-kconv*kDxDefault/2.; xmx=kconv*kDxDefault/2.;
113zmn=-kconv*kDzDefault/2.; zmx=kconv*kDzDefault/2.;
114return kTRUE;
115}
7167ae53 116//
6344adcc 117#endif
118