11 void ApplyCDCOffsets(TString rootFile =
"hd_root.root", TString pedeOutFile =
"millepede.res"){
13 TFile *file = TFile::Open(rootFile);
14 TProfile *hCDCConstants;
15 file->GetObject(
"AlignmentConstants/CDCAlignmentConstants",hCDCConstants);
18 pedeResult.open(pedeOutFile.Data());
20 map < int, double> resultMap;
22 bool firstLine =
true;
24 while (getline(pedeResult,line)){
29 int index;
double value;
30 istringstream iss(line);
31 iss >> index >> value;
33 resultMap[
index]=value;
38 outFile.open(
"cdc_global.txt");
39 for (
unsigned int i = 1; i<=6; i++){
42 outFile << resultMap[pedeIndex] + hCDCConstants->GetBinContent(histIndex) <<
" " ;
47 outFile.open(
"cdc_wire_alignment.txt");
48 for (
unsigned int i = 1001; i<=15088; i++){
51 outFile << resultMap[pedeIndex] + hCDCConstants->GetBinContent(histIndex) <<
" " ;
52 if (i%4 == 0) outFile << endl;
57 outFile.open(
"cdc_t0_alignment.txt");
58 for (
unsigned int i = 16001; i<=19522; i++){
61 outFile << hCDCConstants->GetBinContent(histIndex) - resultMap[pedeIndex]<< endl;
static char index(char c)
void ApplyCDCOffsets(TString rootFile="hd_root.root", TString pedeOutFile="millepede.res")