-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21106 from bsunanda/Run2-alca104
Run2-alca104 Make changes for Hcal Calibration with MIPS
- Loading branch information
Showing
6 changed files
with
667 additions
and
391 deletions.
There are no files selected for viewing
574 changes: 312 additions & 262 deletions
574
Calibration/HcalCalibAlgos/macros/HBHEMuonOfflineAnalyzer.C
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#include "HBHEMuonOfflineAnalyzer.C" | ||
#include <TStyle.h> | ||
#include <TCanvas.h> | ||
#include <iostream> | ||
#include <fstream> | ||
#include <TROOT.h> | ||
#include <TChain.h> | ||
#include <TFile.h> | ||
#include <TProfile.h> | ||
#include <TH1D.h> | ||
#include <TH2D.h> | ||
#include <vector> | ||
#include <TTree.h> | ||
#include <string> | ||
#include "TString.h" | ||
using namespace std; | ||
|
||
Bool_t FillChain(TChain *chain, const char* inputFileList); | ||
|
||
int main(Int_t argc, Char_t *argv[]) { | ||
|
||
if (argc<4) { | ||
std::cerr << "Please give 3 arguments \n" | ||
<< "InputFileName" << "\n" | ||
<< "outputFileName" << "\n" | ||
<< "processName" << "\n" | ||
<< std::endl; | ||
return -1; | ||
} | ||
|
||
const char *inputFileList = argv[1]; | ||
const char *outFileName = argv[2]; | ||
const char *processName = argv[3]; | ||
std::cout << "Input File List " << inputFileList << std::endl | ||
<< "Output FIle Name " << outFileName << std::endl | ||
<< "Process Name " << processName << std::endl; | ||
|
||
int flag(0), mode(4), maxDHB(5), maxDHE(7), runLo(0), runHi(9999999); | ||
if (argc>4) flag = atoi(argv[4]); | ||
if (argc>5) mode = atoi(argv[5]); | ||
if (argc>6) maxDHB = atoi(argv[6]); | ||
if (argc>7) maxDHE = atoi(argv[7]); | ||
if (argc>8) runLo = atoi(argv[8]); | ||
if (argc>9) runHi = atoi(argv[9]); | ||
char treeName[400]; | ||
sprintf (treeName, "%s/TREE", processName); | ||
std::cout << "try to create a chain for " << treeName << std::endl; | ||
TChain *chain = new TChain(treeName); | ||
|
||
if (FillChain(chain, inputFileList)) { | ||
|
||
HBHEMuonOfflineAnalyzer* tree = new HBHEMuonOfflineAnalyzer(chain, outFileName, flag, mode, maxDHB, maxDHE, runLo, runHi); | ||
tree->Loop(); | ||
|
||
} | ||
return 0; | ||
} | ||
|
||
Bool_t FillChain(TChain *chain, const char* inputFileList) { | ||
|
||
ifstream infile(inputFileList); | ||
#if 0 | ||
std::string buffer; | ||
#endif | ||
if (!infile.is_open()) { | ||
std::cerr << "** ERROR: Can't open '" << inputFileList << "' for input" << std::endl; | ||
return kFALSE; | ||
} | ||
|
||
std::cout << "TreeUtilities : FillChain " << std::endl; | ||
char buffer[255]; | ||
while (infile) { | ||
infile.getline(buffer, 255); // delim defaults to '\n' | ||
if (!infile.good()) break; | ||
std::cout << "Adding " << buffer << " to chain" << std::endl; | ||
chain->Add(buffer); | ||
} | ||
#if 0 | ||
while (1) { | ||
infile >> buffer; | ||
if (!infile.good()) break; | ||
chain->Add(buffer.c_str()); | ||
} | ||
#endif | ||
std::cout << "No. of Entries in this tree : " << chain->GetEntries() << std::endl; | ||
infile.close(); | ||
return kTRUE; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
g++ -Wall -Wno-deprecated -I./ `root-config --cflags` OfflineMain.C -o OfflineMain.exe `root-config --libs` | ||
|
Oops, something went wrong.