1 /////////////////////////////////////////////////////////////////////
2 // Author: Henrik Tydesjo //
4 // This class is used to generate Fast-OR signals from SPD chips. //
6 // This procedure is meant to be used during the digitization, //
7 // and will be based on the number of pixels firing in each chip. //
8 // The method 'ProcessPixelHit' should be used for each fired //
9 // pixel. An efficiency value on Fast-Or signal creation upon a //
10 // single fired pixel will then be used. Optionally, there may be //
11 // one value per chip or even one value per column. These values //
12 // are taken from the class AliITSFOEfficiencySPD, normally placed //
15 // Through a similar class, AliITSFONoiseSPD, there is a //
16 // possibility to apply random noise to the generation of fast-or //
17 // signals. This will then be performed by method 'ProcessNoise', //
18 // normally called after the processing of the fired pixels. //
20 // The output signals are represented by the AliITSFOsignalsSPD //
21 // class. Basically, it contains a bit map with all the 1200 pixel //
23 /////////////////////////////////////////////////////////////////////
25 #include "AliITSFOGeneratorSPD.h"
26 #include "AliITSRawStreamSPD.h"
29 AliITSFOGeneratorSPD::AliITSFOGeneratorSPD() :
30 fSignals(), fOCDBEff(NULL), fOCDBNoise(NULL)
32 // default constructor
34 //______________________________________________________________________
35 AliITSFOGeneratorSPD::AliITSFOGeneratorSPD(AliITSFOEfficiencySPD* ocdbEff, AliITSFONoiseSPD* ocdbNoise) :
36 fSignals(), fOCDBEff(ocdbEff), fOCDBNoise(ocdbNoise)
40 //______________________________________________________________________
41 AliITSFOGeneratorSPD::AliITSFOGeneratorSPD(const AliITSFOGeneratorSPD& handle):
42 fSignals(handle.fSignals), fOCDBEff(handle.fOCDBEff), fOCDBNoise(handle.fOCDBNoise)
46 //______________________________________________________________________
47 AliITSFOGeneratorSPD::~AliITSFOGeneratorSPD() {
50 //______________________________________________________________________
51 AliITSFOGeneratorSPD& AliITSFOGeneratorSPD::operator=(const AliITSFOGeneratorSPD& handle) {
52 // assignment operator
54 fSignals = handle.fSignals;
55 fOCDBEff = handle.fOCDBEff;
56 fOCDBNoise = handle.fOCDBNoise;
60 //______________________________________________________________________
61 void AliITSFOGeneratorSPD::SetEfficiencyAndNoise(AliITSFOEfficiencySPD* ocdbEff, AliITSFONoiseSPD* ocdbNoise) {
62 // Method to give pointers to the OCDB entries, needed by methods ProcessPixelHit and ProcessNoise
63 SetEfficiency(ocdbEff);
66 //______________________________________________________________________
67 void AliITSFOGeneratorSPD::SetEfficiency(AliITSFOEfficiencySPD* ocdbEff) {
68 // Method to give pointer to the OCDB efficiency entry
71 //______________________________________________________________________
72 void AliITSFOGeneratorSPD::SetNoise(AliITSFONoiseSPD* ocdbNoise) {
73 // Method to give pointer to the OCDB noise entry
74 fOCDBNoise = ocdbNoise;
76 //______________________________________________________________________
77 void AliITSFOGeneratorSPD::ProcessPixelHit(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row) {
78 // Here it will be decided wether a fired pixel will give rise to a fast-or signal or not
79 if (eq>=20 || hs>=6 || chip>=10 || col>=32 || row>=256) {
80 Error("AliITSFOGeneratorSPD::ProcessPixelHit", "eq,hs,chip,col,row (%d,%d,%d,%d,%d) out of bounds.",
85 Error("AliITSFOGeneratorSPD::ProcessPixelHit", "No AliITSFOEfficiencySPD entry has been provided.");
88 // simulate if this fired pixel gives rise to a fast-or signal:
89 if (gRandom->Rndm() < fOCDBEff->GetColumnEfficiency(eq,hs,chip,col)) {
90 fSignals.SetSignal(eq,hs,chip);
93 //______________________________________________________________________
94 void AliITSFOGeneratorSPD::ProcessPixelHitM(UInt_t module, UInt_t colM, UInt_t rowM) {
95 // Converts offline coordinates to online, and calls ProcessPixelHit
96 if (module>=240 || colM>=160 || rowM>=256) {
97 Error("AliITSFOGeneratorSPD::ProcessPixelHitM", "module,colM,rowM (%d,%d,%d) out of bounds.",
101 UInt_t eq,hs,chip,col,row;
102 if (AliITSRawStreamSPD::OfflineToOnline(module,colM,rowM,eq,hs,chip,col,row)) {
103 ProcessPixelHit(eq,hs,chip,col,row);
106 //______________________________________________________________________
107 void AliITSFOGeneratorSPD::ProcessNoise() {
109 if (fOCDBNoise==NULL) {
110 Error("AliITSFOGeneratorSPD::ProcessNoise", "No AliITSFONoiseSPD entry has been provided.");
113 // simulate if each pixel chip will give rise to a random noise induced fast-or signal:
114 for (UInt_t eq=0; eq<20; eq++) {
115 for (UInt_t hs=0; hs<6; hs++) {
116 for (UInt_t chip=0; chip<10; chip++) {
117 if (gRandom->Rndm() < fOCDBNoise->GetChipNoise(eq,hs,chip)) {
118 fSignals.SetSignal(eq,hs,chip);