From 44b6212f2d8e219e48637a3a1b681ca094f9721e Mon Sep 17 00:00:00 2001 From: cheynis Date: Tue, 2 Sep 2008 07:12:59 +0000 Subject: [PATCH] MIP calculation added --- VZERO/AliVZEROReconstructor.cxx | 65 ++++++++++++++++++++++++--------- 1 file changed, 48 insertions(+), 17 deletions(-) diff --git a/VZERO/AliVZEROReconstructor.cxx b/VZERO/AliVZEROReconstructor.cxx index 09cca183a42..f250ee65740 100644 --- a/VZERO/AliVZEROReconstructor.cxx +++ b/VZERO/AliVZEROReconstructor.cxx @@ -40,6 +40,7 @@ AliVZEROReconstructor:: AliVZEROReconstructor(): AliReconstructor(), // Get calibration data // fCalibData = GetCalibData(); + } @@ -57,8 +58,8 @@ AliVZEROReconstructor& AliVZEROReconstructor::operator = AliVZEROReconstructor::~AliVZEROReconstructor() { // destructor - delete fESDVZERO; - + + delete fESDVZERO; } //_____________________________________________________________________________ @@ -72,7 +73,7 @@ void AliVZEROReconstructor::Init() //______________________________________________________________________ void AliVZEROReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digitsTree) const { -// converts RAW to digits +// converts RAW to digits - pedestal is subtracted if (!digitsTree) { AliError("No digits tree!"); @@ -87,7 +88,7 @@ void AliVZEROReconstructor::ConvertDigits(AliRawReader* rawReader, TTree* digits if (rawStream.Next()) { Int_t ADC_max[64], adc[64], time[64]; for(Int_t i=0; i<64; i++) { - // Search for the maximun charge in the train of 21 LHC clocks + // Search for the maximum charge in the train of 21 LHC clocks // regardless of the integrator which has been operated: ADC_max[i] = 0; for(Int_t iClock=0; iClock<21; iClock++){ @@ -124,15 +125,12 @@ void AliVZEROReconstructor::FillESD(TTree* digitsTree, TTree* /*clustersTree*/, TBranch* digitBranch = digitsTree->GetBranch("VZERODigit"); digitBranch->SetAddress(&digitsArray); - const Float_t mip0=110.0; Short_t Multiplicity[64]; - Float_t mult[64]; - Short_t adc[64]; + Float_t mult[64]; + Short_t adc[64]; Short_t time[64]; - Float_t mip[64]; for (Int_t i=0; i<64; i++){ adc[i] = 0; - mip[i] = mip0; mult[i]= 0.0; } @@ -150,9 +148,10 @@ void AliVZEROReconstructor::FillESD(TTree* digitsTree, TTree* /*clustersTree*/, Int_t pedestal = int(fCalibData->GetPedestal(d)); adc[pmNumber] = (Short_t) digit->ADC() - pedestal; time[pmNumber] = (Short_t) digit->Time(); - // cut of ADC at MIP/2 - if (adc[pmNumber] > (mip[pmNumber]/2)) - mult[pmNumber] += float(adc[pmNumber])/mip[pmNumber]; + // printf("PM = %d, MIP per ADC channel = %f \n",pmNumber, GetMIP(pmNumber)); + // cut of ADC at 1MIP/2 + if (adc[pmNumber] > (int(1.0/GetMIP(pmNumber)) /2) ) + mult[pmNumber] += float(adc[pmNumber])*GetMIP(pmNumber); } // end of loop over digits } // end of loop over events in digits tree @@ -164,7 +163,7 @@ void AliVZEROReconstructor::FillESD(TTree* digitsTree, TTree* /*clustersTree*/, // now get the trigger mask AliVZEROTriggerMask *TriggerMask = new AliVZEROTriggerMask(); - TriggerMask->SetAdcThreshold(mip0/2.0); + TriggerMask->SetAdcThreshold(20.0/2.0); TriggerMask->SetTimeWindowWidthBBA(50); TriggerMask->SetTimeWindowWidthBGA(20); TriggerMask->SetTimeWindowWidthBBC(50); @@ -177,8 +176,8 @@ void AliVZEROReconstructor::FillESD(TTree* digitsTree, TTree* /*clustersTree*/, fESDVZERO->SetBGtriggerV0C(TriggerMask->GetBGtriggerV0C()); if (esd) { - AliDebug(1, Form("Writing VZERO data to ESD tree")); - esd->SetVZEROData(fESDVZERO); + AliDebug(1, Form("Writing VZERO data to ESD tree")); + esd->SetVZEROData(fESDVZERO); } } @@ -201,8 +200,8 @@ AliCDBStorage* AliVZEROReconstructor::SetStorage(const char *uri) AliCDBStorage *storage = manager->GetDefaultStorage(); if(deleteManager){ - AliCDBManager::Instance()->UnsetDefaultStorage(); - defstorage = 0; // the storage is killed by AliCDBManager::Instance()->Destroy() + AliCDBManager::Instance()->UnsetDefaultStorage(); + defstorage = 0; // the storage is killed by AliCDBManager::Instance()->Destroy() } return storage; @@ -237,3 +236,35 @@ AliVZEROCalibData* AliVZEROReconstructor::GetCalibData() const return calibdata; } + +//_____________________________________________________________________________ +Float_t AliVZEROReconstructor::GetMIP(Int_t channel) const { + +// Computes the MIP conversion factor - MIP per ADC channel - +// Argument passed is the PM number (aliroot numbering) + + Float_t P0[64] = { + 7.094891, 7.124938, 7.089708, 7.098169, 7.094482, 7.147250, 7.170978, 7.183392, + 7.145760, 7.148096, 7.153840, 7.143544, 7.186069, 7.194580, 7.203516, 7.195176, + 7.188333, 7.198607, 7.209412, 7.226565, 7.221695, 7.205132, 7.191238, 7.227724, + 7.232810, 7.252655, 7.230309, 7.273518, 7.273518, 7.242969, 7.252859, 7.252655, + 7.026802, 7.079913, 7.134147, 7.092387, 7.079561, 7.072848, 7.123192, 7.003141, + 7.024667, 7.124784, 7.123442, 7.129744, 7.110671, 7.143031, 7.139439, 7.178109, + 7.247803, 7.139396, 7.293809, 7.094454, 6.992198, 7.206448, 7.244765, 7.056197, + 7.263595, 7.138569, 7.089582, 7.215683, 7.266183, 7.165123, 7.243276, 7.235135 }; + Float_t P1[64] = { + 0.135569, 0.146405, 0.142425, 0.144278, 0.142307, 0.141648, 0.128477, 0.138239, + 0.144173, 0.143419, 0.143572, 0.144482, 0.138024, 0.136542, 0.135955, 0.138537, + 0.148521, 0.141999, 0.139627, 0.130014, 0.134970, 0.135635, 0.139094, 0.140634, + 0.137971, 0.142080, 0.142793, 0.142778, 0.142778, 0.146045, 0.139133, 0.142080, + 0.144121, 0.142311, 0.136564, 0.142686, 0.138792, 0.166285, 0.136387, 0.155391, + 0.176082, 0.140408, 0.164738, 0.144270, 0.142766, 0.147486, 0.141951, 0.138012, + 0.132394, 0.142849, 0.140477, 0.144592, 0.141558, 0.157646, 0.143758, 0.173385, + 0.146489, 0.143279, 0.145230, 0.147203, 0.147333, 0.144979, 0.148597, 0.138985 }; + +// High Voltage retrieval from Calibration Data Base: + Float_t HV = fCalibData->GetMeanHV(channel); + Float_t MIP = 0.5/TMath::Exp((TMath::Log(HV) - P0[channel] )/P1[channel]); + return MIP; + +} -- 2.43.0