AliPhysics  1811c8f (1811c8f)
HVrecalculation_EMCALthirds.C File Reference

HV recalculation. More...

#include <signal.h>
#include <stdio.h>
#include <vector>
#include <iostream>
#include <fstream>
#include <string>
#include <iosfwd>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <map>
#include <utility>
#include <iterator>
#include <TSystem.h>
#include <TApplication.h>
#include <TChain.h>
#include <TF1.h>
#include <TH1F.h>
#include <TH2F.h>
#include <TFile.h>
#include <TCanvas.h>
#include <TFrame.h>
#include <TPostScript.h>
#include <TLine.h>
#include <TGaxis.h>
#include <TStyle.h>
#include <TGraphErrors.h>
#include <TMath.h>
#include <TMatrixF.h>
#include <TText.h>
Include dependency graph for HVrecalculation_EMCALthirds.C:

Go to the source code of this file.

Namespaces

 std
 

Enumerations

enum  detType {
  kEMCAL, kEMCALthird, kDCAL, kDCALthird,
  kEMCAL, kEMCALthird, kDCAL, kDCALthird,
  kEMCAL, kEMCALthird, kDCAL, kDCALthird,
  kEMCAL, kEMCALthird, kDCAL, kDCALthird,
  kEMCAL, kEMCALthird, kDCAL, kDCALthird,
  kEMCAL, kEMCALthird, kDCAL, kDCALthird,
  kEMCAL, kEMCALthird, kDCAL, kDCALthird,
  kEMCAL, kEMCALthird, kDCAL, kDCALthird,
  kEMCAL, kEMCALthird, kDCAL, kDCALthird
}
 

Functions

void CalcNewHVperSM (TString hvFileName, TString paramFileName, int smNb, char *fchNameBase, FILE *outFile, FILE *badGainFileOut, double coeffOCDB[kNbSMtot][kNbColMax][kNbRowMax], double coeffCalib[kNbSMtot][kNbColMax][kNbRowMax], double forcedGainChange[kNbSMtot][kNbColMax][kNbRowMax], double forcedOCDBcoeff[kNbSMtot][kNbColMax][kNbRowMax], int flag[kNbSMtot][kNbColMax][kNbRowMax], TPostScript *ps, TCanvas *c1)
 
void HVrecalculation_EMCALthirds (TString ident, int choiceArg=0b0010)
 

Variables

const double kMaxHV = 395.
 
const double kMinHV = 210.
 
const double coefFactorWanted =0.0162
 
char SMP2Name [][100] ={"SMA0","SMC0","SMA1","SMC1","SMA2","SMC2","SMA3","SMC3","SMA4","SMC4","SMA5","SMC5","SMA9","SMC9","SMA10","SMC10","SMA11","SMC11","SMA12","SMC12"}
 
char SMcalibName [][100] ={"US2","US1","EU2","EU1","US3","US5","US4","EU3","US7","US6","US8C0","US8C2","DCN1","DJP1","DUS2","DUS1","DJP2","DUS3","CN1A","CN1C"}
 
char SMnumber [][100] ={"0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"}
 
int detTypeType [] ={kEMCAL,kEMCALthird,kDCAL,kDCALthird}
 
char detTypeString [][100] ={"EMCAL","EMCALthird","DCAL","DCALthird"}
 
int SMdetType [] ={kEMCAL,kEMCAL,kEMCAL,kEMCAL,kEMCAL,kEMCAL,kEMCAL,kEMCAL,kEMCAL,kEMCAL,kEMCALthird,kEMCALthird,kDCAL,kDCAL,kDCAL,kDCAL,kDCAL,kDCAL,kDCALthird,kDCALthird}
 
const int kNbColEMCAL =48
 
const int kNbRowEMCAL =24
 
const int kNbSMEMCAL =10
 
const int kNbColEMCALthird =kNbColEMCAL
 
const int kNbRowEMCALthird =(int)(kNbRowEMCAL/3)
 
const int kNbSMEMCALthird =2
 
const int kNbColDCAL =32
 
const int kNbRowDCAL =kNbRowEMCAL
 
const int kNbSMDCAL =6
 
const int kNbColDCALthird =kNbColEMCALthird
 
const int kNbRowDCALthird =kNbRowEMCALthird
 
const int kNbSMDCALthird =2
 
const int kNbSMtot =kNbSMEMCAL+kNbSMEMCALthird+kNbSMDCAL+kNbSMDCALthird
 
const int kTabNbCol [4] ={kNbColEMCAL,kNbColEMCALthird,kNbColDCAL,kNbColDCALthird}
 
const int kTabNbRow [4] ={kNbRowEMCAL,kNbRowEMCALthird,kNbRowDCAL,kNbRowDCALthird}
 
const int kTabNbSM [4] ={kNbSMEMCAL,kNbSMEMCALthird,kNbSMDCAL,kNbSMDCALthird}
 
const int kNbColMax =kNbColEMCAL
 
const int kNbRowMax =kNbRowEMCAL
 
const int kNbColOffsetDCAL =kNbColEMCAL-kNbColDCAL
 
int lastSM
 

Detailed Description

HV recalculation.

HV recalculation for 1/3 SMs, see HVrecalculation.C for full

How to run : Customize fchNameBadGainIn, then run :

root -b -q 'macros/HVrecalculation_EMCALthirds.C++("ident")'

Stored in the "badGain file" : SM col row choice gain1 gain2 gain3 OCDBcoeff "choice" is 1, 2 or 3 ; gain1 = default value calculated by the program ; gain2 = gain 1.000 (no HV change) ; gain3 = a value to be set in the file by the user. Choice 4 [obsolete] = same as choice 3 (picks up the 3rd gain value) but is used as a tag to recognize values copy-pasted by the code from a pass to the next one (as opposed to manual setting of the choice by hand in the file). Choices 11, 12, 13 : same as 1, 2, 3, except that they've been copied from the "badGainIn" file. Choice -3 = force take gain3 and OCDBcoeff. Choice 000 = bad HV scan not detected by the code.

This code reads HV's for year N-1, OCDB coeffs for year N-1 from pi0 calibration, (p0,p1,p2) parameters from a recent HV scan, and calculates HV's for year N (to come) with associated OCDB coeffs (most often 0.0162).

Mapping convention :

  • All text HVs (input and output)(NewBias.txt files) are in Grenoble cosmic = electronic mapping.
  • All OCDB files (input and output) are in Alice offline mapping (identical for side A, flipped rows and cols for side C).
  • The file with the calib coeffs is in Alice offline mapping (identical for side A, flipped rows and cols for side C).
  • Inside the code, everything is in Grenoble cosmic = electronic mapping, i.e. the OCDB tower coordinates are flipped at reading and writing, and the calib coeffs are flipped at reading.
  • Col/row plots ("hSpace") are drawn with Grenoble cosmic = electronic mapping for all SMs.
  • (p0,p1,p2) parameters file : Grenoble cosmic = electronic mapping. (Caution : flipped doesn't mean col <–> row, but iCol <–> (kNbCol-1)-iCol and iRow <–> (kNbRow-1)-iRow).
Author
Julien Faivre, Julie.nosp@m.n.Fa.nosp@m.ivre@.nosp@m.cern.nosp@m..ch, (LPSC-CNRS)

Definition in file HVrecalculation_EMCALthirds.C.

Enumeration Type Documentation

enum detType
Enumerator
kEMCAL 
kEMCALthird 
kDCAL 
kDCALthird 
kEMCAL 
kEMCALthird 
kDCAL 
kDCALthird 
kEMCAL 
kEMCALthird 
kDCAL 
kDCALthird 
kEMCAL 
kEMCALthird 
kDCAL 
kDCALthird 
kEMCAL 
kEMCALthird 
kDCAL 
kDCALthird 
kEMCAL 
kEMCALthird 
kDCAL 
kDCALthird 
kEMCAL 
kEMCALthird 
kDCAL 
kDCALthird 
kEMCAL 
kEMCALthird 
kDCAL 
kDCALthird 
kEMCAL 
kEMCALthird 
kDCAL 
kDCALthird 

Definition at line 55 of file HVrecalculation_EMCALthirds.C.

Function Documentation

void CalcNewHVperSM ( TString  hvFileName,
TString  paramFileName,
int  smNb,
char *  fchNameBase,
FILE *  outFile,
FILE *  badGainFileOut,
double  coeffOCDB[kNbSMtot][kNbColMax][kNbRowMax],
double  coeffCalib[kNbSMtot][kNbColMax][kNbRowMax],
double  forcedGainChange[kNbSMtot][kNbColMax][kNbRowMax],
double  forcedOCDBcoeff[kNbSMtot][kNbColMax][kNbRowMax],
int  flag[kNbSMtot][kNbColMax][kNbRowMax],
TPostScript *  ps,
TCanvas *  c1 
)

Add comment

Definition at line 134 of file HVrecalculation_EMCALthirds.C.

Referenced by HVrecalculation_EMCALthirds().

void HVrecalculation_EMCALthirds ( TString  ident,
int  choiceArg = 0b0010 
)

Main method

Parameters
choiceArgindicates which SM are used : 10^0 = EMCAL, 10^1 = EMCAL thirds, 10^2 = DCAL, 10^3 = DCAL thirds, 0 = no, 1 = yes. Therefore : old EMCAL SMs only -> choiceArg = 0b0001 ; thirds only -> choiceArg = 0b1010 ; DCAL only -> choiceArg = 0b0100. Caution, do not write eg '0001', because integers with a leading zero in C are interpreted as octal values. Instead, write '0b0001' to state it's binary.

Definition at line 580 of file HVrecalculation_EMCALthirds.C.

Variable Documentation

const double coefFactorWanted =0.0162

Definition at line 47 of file HVrecalculation_EMCALthirds.C.

Referenced by CalcNewHVperSM().

char detTypeString[][100] ={"EMCAL","EMCALthird","DCAL","DCALthird"}

Definition at line 57 of file HVrecalculation_EMCALthirds.C.

Referenced by CalcNewHVperSM(), and HVrecalculation_EMCALthirds().

int detTypeType[] ={kEMCAL,kEMCALthird,kDCAL,kDCALthird}

Definition at line 56 of file HVrecalculation_EMCALthirds.C.

const double kMaxHV = 395.

Definition at line 45 of file HVrecalculation_EMCALthirds.C.

Referenced by CalcNewHVperSM().

const double kMinHV = 210.

Definition at line 46 of file HVrecalculation_EMCALthirds.C.

Referenced by CalcNewHVperSM().

const int kNbColDCAL =32

Definition at line 65 of file HVrecalculation_EMCALthirds.C.

const int kNbColDCALthird =kNbColEMCALthird

Definition at line 68 of file HVrecalculation_EMCALthirds.C.

const int kNbColEMCAL =48

Definition at line 59 of file HVrecalculation_EMCALthirds.C.

const int kNbColEMCALthird =kNbColEMCAL

Definition at line 62 of file HVrecalculation_EMCALthirds.C.

const int kNbColMax =kNbColEMCAL

Definition at line 75 of file HVrecalculation_EMCALthirds.C.

Referenced by CalcNewHVperSM(), and HVrecalculation_EMCALthirds().

const int kNbColOffsetDCAL =kNbColEMCAL-kNbColDCAL

Definition at line 77 of file HVrecalculation_EMCALthirds.C.

const int kNbRowDCAL =kNbRowEMCAL

Definition at line 66 of file HVrecalculation_EMCALthirds.C.

const int kNbRowDCALthird =kNbRowEMCALthird

Definition at line 69 of file HVrecalculation_EMCALthirds.C.

const int kNbRowEMCAL =24

Definition at line 60 of file HVrecalculation_EMCALthirds.C.

const int kNbRowEMCALthird =(int)(kNbRowEMCAL/3)

Definition at line 63 of file HVrecalculation_EMCALthirds.C.

const int kNbRowMax =kNbRowEMCAL

Definition at line 76 of file HVrecalculation_EMCALthirds.C.

Referenced by CalcNewHVperSM(), and HVrecalculation_EMCALthirds().

const int kNbSMDCAL =6

Definition at line 67 of file HVrecalculation_EMCALthirds.C.

Referenced by HVrecalculation_EMCALthirds().

const int kNbSMDCALthird =2

Definition at line 70 of file HVrecalculation_EMCALthirds.C.

const int kNbSMEMCAL =10

Definition at line 61 of file HVrecalculation_EMCALthirds.C.

Referenced by HVrecalculation_EMCALthirds().

const int kNbSMEMCALthird =2

Definition at line 64 of file HVrecalculation_EMCALthirds.C.

Referenced by HVrecalculation_EMCALthirds().

Definition at line 72 of file HVrecalculation_EMCALthirds.C.

Definition at line 73 of file HVrecalculation_EMCALthirds.C.

Definition at line 74 of file HVrecalculation_EMCALthirds.C.

int lastSM

Definition at line 79 of file HVrecalculation_EMCALthirds.C.

char SMcalibName[][100] ={"US2","US1","EU2","EU1","US3","US5","US4","EU3","US7","US6","US8C0","US8C2","DCN1","DJP1","DUS2","DUS1","DJP2","DUS3","CN1A","CN1C"}

Definition at line 52 of file HVrecalculation_EMCALthirds.C.

Referenced by HVrecalculation_EMCALthirds().

char SMnumber[][100] ={"0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19"}

Definition at line 53 of file HVrecalculation_EMCALthirds.C.

Referenced by HVrecalculation_EMCALthirds().

char SMP2Name[][100] ={"SMA0","SMC0","SMA1","SMC1","SMA2","SMC2","SMA3","SMC3","SMA4","SMC4","SMA5","SMC5","SMA9","SMC9","SMA10","SMC10","SMA11","SMC11","SMA12","SMC12"}

Definition at line 51 of file HVrecalculation_EMCALthirds.C.

Referenced by CalcNewHVperSM(), and HVrecalculation_EMCALthirds().