Compare commits
2 Commits
e6c6620426
...
51952ea5f2
Author | SHA1 | Date | |
---|---|---|---|
|
51952ea5f2 | ||
|
2d44063e56 |
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include <TMacro.h>
|
#include <TMacro.h>
|
||||||
#include <TList.h>
|
#include <TList.h>
|
||||||
|
#include <TMath.h>
|
||||||
#include <TObjArray.h>
|
#include <TObjArray.h>
|
||||||
#include <TCutG.h>
|
#include <TCutG.h>
|
||||||
|
|
||||||
|
|
|
@ -92,6 +92,7 @@ elif [ ${EventBld} -ge 1 ]; then
|
||||||
else
|
else
|
||||||
echo -e "${GREEN} root data are newer than raw data. No need to merged again.${NC}"
|
echo -e "${GREEN} root data are newer than raw data. No need to merged again.${NC}"
|
||||||
echo -e "${GREEN} You can Force merging using option -${EventBld}, ${ORANGE} see ./process_run.sh -help${NC}"
|
echo -e "${GREEN} You can Force merging using option -${EventBld}, ${ORANGE} see ./process_run.sh -help${NC}"
|
||||||
|
echo -e "${LRED}>>>>>>>>>>>>>>>>>>>>> Event Building Skipped. ${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
|
@ -18,7 +18,7 @@ if [ $# -eq 0 ] || [ $1 == "-help" ]; then
|
||||||
echo " TraceMethod = -1/0/1/2 || -1 no trace, 0 save trace, 1 fit, 2 trapezoid(not implemented)"
|
echo " TraceMethod = -1/0/1/2 || -1 no trace, 0 save trace, 1 fit, 2 trapezoid(not implemented)"
|
||||||
echo " Monitor = 2/1/0 || 1 = single run, 2 = using the list in ChainMonitors.C"
|
echo " Monitor = 2/1/0 || 1 = single run, 2 = using the list in ChainMonitors.C"
|
||||||
echo ""
|
echo ""
|
||||||
echo " * negative option = force (except for TraceMethod)."
|
echo " * negative option = force (except for TraceMethod and Monitor)."
|
||||||
echo " * Defult timeWindow for Event builder is 100 tick = 800 ns."
|
echo " * Defult timeWindow for Event builder is 100 tick = 800 ns."
|
||||||
echo ""
|
echo ""
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -30,7 +30,7 @@ runNum=$1
|
||||||
EventBld=2
|
EventBld=2
|
||||||
nWorker=1
|
nWorker=1
|
||||||
TraceMethod=-1
|
TraceMethod=-1
|
||||||
isMonitor=0
|
isMonitor=1
|
||||||
|
|
||||||
if [ $# -ge 2 ]; then EventBld=$2; fi
|
if [ $# -ge 2 ]; then EventBld=$2; fi
|
||||||
if [ $# -ge 3 ]; then nWorker=$3; fi
|
if [ $# -ge 3 ]; then nWorker=$3; fi
|
||||||
|
@ -81,6 +81,13 @@ if [ $isRunDataExist ]; then
|
||||||
fi
|
fi
|
||||||
#################################### Monitor
|
#################################### Monitor
|
||||||
|
|
||||||
|
if [ $isMonitor -eq 0 ]; then
|
||||||
|
echo -e "${LRED}>>>>>>>>>>>>>>>>>>>>> Monitor Skipped by user. ${NC}"
|
||||||
|
elif [ $isMonitor -eq 1 ]; then
|
||||||
|
root -l "ChainMonitors.C($RUN)"
|
||||||
|
elif [ $isMonitor -eq 2 ]; then
|
||||||
|
root -l "ChainMonitors.C"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -76,13 +76,14 @@ else
|
||||||
|
|
||||||
if [ $rootDataTime -ge $genRootDataTime ]; then
|
if [ $rootDataTime -ge $genRootDataTime ]; then
|
||||||
|
|
||||||
echo -e "${LRED}>>>>>>>>>>>>>>>>>>>>> Event Building $(date) ${NC}"
|
echo -e "${LRED}>>>>>>>>>>>>>>>>>>>>> GeneralSort $(date) ${NC}"
|
||||||
root -l -q -b "$SOLARISANADIR/armory/GeneralSortAgent.C($runNum, $nWorker, $TraceMethod)"
|
root -l -q -b "$SOLARISANADIR/armory/GeneralSortAgent.C($runNum, $nWorker, $TraceMethod)"
|
||||||
echo -e "${LRED}<<<<<<<<<<<<<<<< Done Event Building $(date) ${NC}"
|
echo -e "${LRED}<<<<<<<<<<<<<<<< Done GeneralSort $(date) ${NC}"
|
||||||
|
|
||||||
else
|
else
|
||||||
echo -e "${GREEN} gen_run$RUN.root is newer than run$RUN.root. No need to GeneralSort again.${NC}"
|
echo -e "${GREEN} gen_run$RUN.root is newer than run$RUN.root. No need to GeneralSort again.${NC}"
|
||||||
echo -e "${GREEN} You can Force GeneralSort using option -${nWorker}, ${ORANGE} see Process_Run -help${NC}"
|
echo -e "${GREEN} You can Force GeneralSort using option -${nWorker}, ${ORANGE} see Process_Run -help${NC}"
|
||||||
|
echo -e "${LRED}>>>>>>>>>>>>>>>>>>>>> GeneralSort Skipped. ${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -37,7 +37,7 @@ void ChainMonitors(int RUNNUM = -1, int RUNNUM2 = -1) {
|
||||||
printf("\033[0;31m========================================== Number of Files : %2d\n",fileList->GetEntries());
|
printf("\033[0;31m========================================== Number of Files : %2d\n",fileList->GetEntries());
|
||||||
fileList->Print();
|
fileList->Print();
|
||||||
printf("========================================== Number of Files : %2d\033[0m\n",fileList->GetEntries());
|
printf("========================================== Number of Files : %2d\033[0m\n",fileList->GetEntries());
|
||||||
printf(" number of entries : %llu \n", chain->GetEntries());
|
printf("---------------------------------- Total Number of entries : %llu \n", chain->GetEntries());
|
||||||
|
|
||||||
double totDuration = 0;
|
double totDuration = 0;
|
||||||
std::vector<ULong64_t> startTime;
|
std::vector<ULong64_t> startTime;
|
||||||
|
@ -70,8 +70,6 @@ void ChainMonitors(int RUNNUM = -1, int RUNNUM2 = -1) {
|
||||||
TString title = "Run:" + create_range_string(runList);
|
TString title = "Run:" + create_range_string(runList);
|
||||||
title += Form(" | %.0f min", totDuration/60.) ;
|
title += Form(" | %.0f min", totDuration/60.) ;
|
||||||
|
|
||||||
printf("%s\n", title.Data());
|
|
||||||
|
|
||||||
//Some input to TSelector
|
//Some input to TSelector
|
||||||
Monitor * selector = new Monitor();
|
Monitor * selector = new Monitor();
|
||||||
selector->SetCanvasTitle(title);
|
selector->SetCanvasTitle(title);
|
||||||
|
|
57
working/DataHoSei.C
Normal file
57
working/DataHoSei.C
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
#define DataHoSei_cxx
|
||||||
|
|
||||||
|
#include "DataHoSei.h"
|
||||||
|
#include <TH2.h>
|
||||||
|
#include <TH1.h>
|
||||||
|
#include <TMath.h>
|
||||||
|
#include <TStyle.h>
|
||||||
|
|
||||||
|
//^***************************** User Settings
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//******************************** end of User Settings
|
||||||
|
|
||||||
|
TH1F * h1 = new TH1F("h1", "h1", 400, 0, 50000);
|
||||||
|
|
||||||
|
|
||||||
|
void DataHoSei::Begin(TTree * /*tree*/){
|
||||||
|
printf("--------- %s \n", __func__);
|
||||||
|
TString option = GetOption();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Bool_t DataHoSei::Process(Long64_t entry){
|
||||||
|
|
||||||
|
if( entry == 0 ) printf("--------- %s \n", __func__);
|
||||||
|
|
||||||
|
b_e[0]->GetEntry(entry);
|
||||||
|
//printf("%f \n", e[0][1]);
|
||||||
|
|
||||||
|
h1->Fill(e[0][1]);
|
||||||
|
|
||||||
|
// std::vector<std::vector<Float_t>> dataList; // {detID, e, xf, xn}
|
||||||
|
// for( int i = 0; i < mapping::nDetType; i++){
|
||||||
|
std::vector<Float_t> temp;
|
||||||
|
// for( int j = 0; j < mapping::detNum[i]; j++){
|
||||||
|
// if( TMath::IsNaN( e[i][j] ) ) continue;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
return kTRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void DataHoSei::Terminate(){
|
||||||
|
printf("--------- %s \n", __func__);
|
||||||
|
|
||||||
|
h1->Draw();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
printf("----------- A \n");
|
||||||
|
}
|
120
working/DataHoSei.h
Normal file
120
working/DataHoSei.h
Normal file
|
@ -0,0 +1,120 @@
|
||||||
|
//////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// Made by Ryan Tang on 2023, April 6
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef DataHoSei_h
|
||||||
|
#define DataHoSei_h
|
||||||
|
|
||||||
|
#include <TROOT.h>
|
||||||
|
#include <TChain.h>
|
||||||
|
#include <TFile.h>
|
||||||
|
#include <TSelector.h>
|
||||||
|
|
||||||
|
// Header file for the classes stored in the TTree if any.
|
||||||
|
#include "TClonesArray.h"
|
||||||
|
#include "TObject.h"
|
||||||
|
#include "TNamed.h"
|
||||||
|
#include "TAttLine.h"
|
||||||
|
#include "TAttFill.h"
|
||||||
|
#include "TAttMarker.h"
|
||||||
|
#include "TGraph.h"
|
||||||
|
|
||||||
|
#include "Mapping.h"
|
||||||
|
#include "../armory/AnalysisLib.h"
|
||||||
|
|
||||||
|
class DataHoSei : public TSelector {
|
||||||
|
public :
|
||||||
|
TTree *fChain; //!pointer to the analyzed TTree or TChain
|
||||||
|
|
||||||
|
// Declaration of leaf types
|
||||||
|
ULong64_t evID;
|
||||||
|
|
||||||
|
Float_t ** e; // all kind of energy
|
||||||
|
// ULong64_t ** e_t; //! all kind of timestamp
|
||||||
|
|
||||||
|
// Float_t ** we; //! wave energy
|
||||||
|
// Float_t ** weT; //! wave time
|
||||||
|
// Float_t ** weR; //! wave rise time
|
||||||
|
|
||||||
|
// List of branches
|
||||||
|
TBranch *b_evID; //!
|
||||||
|
TBranch **b_e; //!
|
||||||
|
// TBranch **b_e_t; //!
|
||||||
|
|
||||||
|
DataHoSei(TTree * /*tree*/ =0) : fChain(0) {
|
||||||
|
printf("--------- %s \n", __func__);
|
||||||
|
|
||||||
|
e = new Float_t * [mapping::nDetType];
|
||||||
|
b_e = new TBranch * [mapping::nDetType];
|
||||||
|
for( int i = 0 ; i < mapping::nDetType; i++) e[i] = new Float_t[mapping::detNum[i]];
|
||||||
|
|
||||||
|
}
|
||||||
|
virtual ~DataHoSei() {
|
||||||
|
|
||||||
|
printf("--------- %s \n", __func__);
|
||||||
|
|
||||||
|
|
||||||
|
printf("----------- B \n");
|
||||||
|
}
|
||||||
|
virtual Int_t Version() const { return 2; }
|
||||||
|
virtual void Begin(TTree *tree);
|
||||||
|
virtual void SlaveBegin(TTree *tree);
|
||||||
|
virtual void Init(TTree *tree);
|
||||||
|
virtual Bool_t Notify();
|
||||||
|
virtual Bool_t Process(Long64_t entry);
|
||||||
|
virtual Int_t GetEntry(Long64_t entry, Int_t getall = 0) { return fChain ? fChain->GetTree()->GetEntry(entry, getall) : 0; }
|
||||||
|
virtual void SetOption(const char *option) { fOption = option; }
|
||||||
|
virtual void SetObject(TObject *obj) { fObject = obj; }
|
||||||
|
virtual void SetInputList(TList *input) { fInput = input; }
|
||||||
|
virtual TList *GetOutputList() const { return fOutput; }
|
||||||
|
virtual void SlaveTerminate();
|
||||||
|
virtual void Terminate();
|
||||||
|
|
||||||
|
ClassDef(DataHoSei,0);
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DataHoSei_cxx
|
||||||
|
|
||||||
|
void DataHoSei::Init(TTree *tree){
|
||||||
|
|
||||||
|
printf("--------- %s \n", __func__);
|
||||||
|
|
||||||
|
// Set branch addresses and branch pointers
|
||||||
|
if (!tree) return;
|
||||||
|
fChain = tree;
|
||||||
|
fChain->SetMakeClass(1);
|
||||||
|
|
||||||
|
fChain->SetBranchAddress("evID", &evID, &b_evID);
|
||||||
|
|
||||||
|
fChain->SetBranchAddress(mapping::detTypeName[0].c_str(), e[0], &b_e[0]);
|
||||||
|
//for( int i = 0; i < mapping::nDetType; i++){
|
||||||
|
// fChain->SetBranchAddress((mapping::detTypeName[i] + "_t").c_str(), e_t[i], &b_e_t[i]);
|
||||||
|
|
||||||
|
//}
|
||||||
|
|
||||||
|
// TObjArray * branchList = fChain->GetListOfBranches();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void DataHoSei::SlaveBegin(TTree * /*tree*/){
|
||||||
|
printf("--------- %s \n", __func__);
|
||||||
|
TString option = GetOption();
|
||||||
|
}
|
||||||
|
|
||||||
|
void DataHoSei::SlaveTerminate(){
|
||||||
|
printf("--------- %s \n", __func__);
|
||||||
|
}
|
||||||
|
|
||||||
|
Bool_t DataHoSei::Notify(){
|
||||||
|
printf("--------- %s \n", __func__);
|
||||||
|
return kTRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // #ifdef DataHoSei_cxx
|
|
@ -274,7 +274,7 @@ template<typename T> void Monitor::CreateListOfHist1D(T ** &histList,
|
||||||
const char * TitleForm,
|
const char * TitleForm,
|
||||||
int binX, float xMin, float xMax){
|
int binX, float xMin, float xMax){
|
||||||
|
|
||||||
|
//printf(" Making %d of %s.\n", size, namePrefix);
|
||||||
histList = new T * [size];
|
histList = new T * [size];
|
||||||
for(int i = 0; i < size; i++) histList[i] = new T(Form("%s%d", namePrefix, i), Form(TitleForm, i), binX, xMin, xMax);
|
for(int i = 0; i < size; i++) histList[i] = new T(Form("%s%d", namePrefix, i), Form(TitleForm, i), binX, xMin, xMax);
|
||||||
}
|
}
|
||||||
|
@ -286,7 +286,7 @@ template<typename T> void Monitor::CreateListOfHist2D(T ** &histList,
|
||||||
int binX, float xMin, float xMax,
|
int binX, float xMin, float xMax,
|
||||||
int binY, float yMin, float yMax){
|
int binY, float yMin, float yMax){
|
||||||
|
|
||||||
|
//printf(" Making %d of %s.\n", size, namePrefix);
|
||||||
histList = new T * [size];
|
histList = new T * [size];
|
||||||
for(int i = 0; i < size; i++) histList[i] = new T(Form("%s%d", namePrefix, i), Form(TitleForm, i), binX, xMin, xMax, binY, yMin, yMax);
|
for(int i = 0; i < size; i++) histList[i] = new T(Form("%s%d", namePrefix, i), Form(TitleForm, i), binX, xMin, xMax, binY, yMin, yMax);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user