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 // **************************************************************************
16 #include "AliHMPIDCalib.h" //class header
17 #include "TTreePlayer.h"
20 //#include "AliHMPIDDigit.h"
22 ClassImp(AliHMPIDCalib)
25 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
26 AliHMPIDCalib::AliHMPIDCalib():
36 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
37 AliHMPIDCalib::~AliHMPIDCalib()
41 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
42 void AliHMPIDCalib::Init()
45 for(Int_t iddl=0;iddl<11;iddl++) faddl[iddl]=kFALSE;
47 // Called to initialize the TTree in which the raw data words will be stored
49 fPedHisto=new TH1F("fPedHisto","Temporary pedestal",4096,-0.5,4095.5); //init pedestal histo
50 fPedTree = new TTree("PedTree","HMPID Pedestal Tree"); //init pedestal tree
51 fPedTree->Branch("diladd",&fa,"diladd/I");
52 fPedTree->Branch("dilnum",&fd,"dilnum/I");
53 fPedTree->Branch("dilrow",&fr,"dilrow/I");
54 fPedTree->Branch("qdc" ,&fq,"qdc/F ");
56 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
57 void AliHMPIDCalib::FillPedestal(Int_t ddl,Int_t row, Int_t dil,Int_t adr,Int_t q)
60 //Called from the HMPIDda and fills the pedestal tree
67 if(fq>-1) fPedTree->Fill();
69 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
70 Bool_t AliHMPIDCalib::CalcPedestal(Int_t ddl, Char_t* name)
73 //Calculate pedestal for each pad
76 ofstream out; //to write the pedestal text files
79 if(faddl[ddl]==kFALSE) return kFALSE; //if ddl is missing no ped file is created (and also for LDC selection). Check with Paolo what he checks for?!
81 for(Int_t row=1; row < 25; row++){
82 for(Int_t dil=1; dil < 11; dil++){
83 for(Int_t adr=0; adr < 48; adr++){
85 fPedTree->Draw("fq>>fPedHisto",Form("fr==%d&&fd==%d&&fa==%d",row,dil,adr));
86 mean=fPedHisto->GetMean();
87 sigma=fPedHisto->GetRMS();
88 inhard=((Int_t(mean))<<9)+Int_t(mean+3*sigma);
89 out << Form("%2i %2i %2i %5.2f %5.2f %x\n",row,dil,adr,mean,sigma,inhard);
93 out.close(); //write pedestal file
96 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++