Compare commits

..

No commits in common. "f0bcd2abaed6f60f2efc36a0c18fc3a4743bdf57" and "e01c3e81155c49addad148137eb3bb330d4e5150" have entirely different histories.

7 changed files with 29 additions and 1486 deletions

View File

@ -1,14 +1,12 @@
#define PreAnalyzer_cxx
#include "PreAnalyzer.h"
#include <TStyle.h>
#include <TMath.h>
#include <stdio.h>
#define TREESTRUCT 1 // if 0 = multi, 1 = array.
#include "PreAnalyzer.h"
//############################################ BEGIN
void PreAnalyzer::Begin(TTree * tree){
@ -155,32 +153,19 @@ Bool_t PreAnalyzer::Process(Long64_t entry){
//################ Gamma-Paritcle
for( int i = 0 ; i < NCLOVER; i++){
if( gamma[i] > 0 ) {
if( TREESTRUCT == 0 ){
gammaID[multi_N] = i;
gamma_N[multi_N] = gamma[i];
gamma_t[multi_N] = gammaTime[i];
}else{
gamma_N[i] = gamma[i];
gamma_t[i] = gammaTime[i];
}
multi_N++;
}
}
for ( int i = 0 ; i < NGAGG ; i++){
if( count[i] == 2 ){
if ( TREESTRUCT == 0 ){
gaggID[multiGagg_N] = i;
gagg_tail[multiGagg_N] = (tail[i][0]+tail[i][1])/2.;
gagg_peak[multiGagg_N] = (peak[i][0]+peak[i][1])/2.;
gagg_t[multiGagg_N] = gaggTime[i];
}else{
gagg_tail[i] = (tail[i][0]+tail[i][1])/2.;
gagg_peak[i] = (peak[i][0]+peak[i][1])/2.;
gagg_t[i] = gaggTime[i];
}
multiGagg_N++;
}
}
@ -201,10 +186,9 @@ void PreAnalyzer::Terminate(){
saveFile->cd(); //set focus on this file
newTree->Write();
Long64_t nEntries = newTree->GetEntries();
saveFile->Close();
printf("-------------- done, saved in %s. number of entry : %lld\n", saveFileName.Data(), nEntries);
printf("-------------- done, saved in %s.\n", saveFileName.Data());
gROOT->ProcessLine(".q");

View File

@ -141,18 +141,14 @@ void PreAnalyzer::Init(TTree *tree)
eCorr = LoadCorrectionParameters("correction_e.dat");
///======================== open a new file
//TODO, if it is TChain, then we can get file name, else, use option
if( option == "" ){
saveFileName = "haha.root";
}else{
saveFileName = option;
}
saveFile = new TFile( saveFileName,"recreate");
TMacro e_corr("correction_e.dat");
e_corr.Write("correction_e");
newTree = new TTree("tree", saveFileName);
newTree = new TTree("tree", "tree");
eventID = -1;
runID = 0;
@ -160,7 +156,6 @@ void PreAnalyzer::Init(TTree *tree)
multi_N = 0;
multiGagg_N = 0;
if( TREESTRUCT == 0 ){
newTree->Branch("eventID", &eventID, "eventID/l");
newTree->Branch("runID", &runID_N, "runID/I");
newTree->Branch("multi", &multi_N, "multi/I");
@ -172,15 +167,7 @@ void PreAnalyzer::Init(TTree *tree)
newTree->Branch("gaggP", gagg_peak, "gaggP[multiGagg]/D");
newTree->Branch("gaggT", gagg_tail, "gaggT[multiGagg]/D");
newTree->Branch("gagg_t", gagg_t, "gagg_t[multiGagg]/l");
}else{
newTree->Branch("eventID", &eventID, "eventID/l");
newTree->Branch("runID", &runID_N, "runID/I");
newTree->Branch("gamma", gamma_N, Form("gamma[%d]/D", NCLOVER));
newTree->Branch("gamma_t", gamma_t, Form("gamma_t[%d]/l", NCLOVER));
newTree->Branch("gaggP", gagg_peak, Form("gaggP[%d]/D", NGAGG));
newTree->Branch("gaggT", gagg_tail, Form("gaggT[%d]/D", NGAGG));
newTree->Branch("gagg_t", gagg_t, Form("gagg_t[%d]/l", NGAGG));
}
printf("======================== Start processing....\n");
StpWatch.Start();

View File

@ -6,10 +6,6 @@ ROOT 6.00+
Codes need to be compiled are in armory/
# Function of Programs
![Alt text](armory/programs_explain.png?raw=true "program explained")
# armory/DataBlock.h
this is the source file for the class DataBlock, it stored all information from a single data block from pixie16 output.

View File

@ -17,7 +17,7 @@
int main(int argn, char **argv){
printf("=====================================\n");
printf("=== Event Builder from *_raw.root ===\n");
printf("=== Event Builder ===\n");
printf("=====================================\n");
if (argn != 2 && argn != 3 && argn != 4 ) {
@ -80,7 +80,7 @@ int main(int argn, char **argv){
printf(">>> Create output tree\n");
TFile * saveFile = new TFile(outFileName, "recreate");
saveFile->cd();
TTree * newtree = new TTree("tree", outFileName);
TTree * newtree = new TTree("tree", "tree");
Int_t eventID = 0 ;
Int_t multi = 0; /// this is total multipicilty for all detectors

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 654 KiB

View File

@ -77,7 +77,7 @@ int main(int argc, char **argv) {
TFile * outRootFile = new TFile(outFileName, "recreate");
outRootFile->cd();
TTree * tree = new TTree("tree", outFileName);
TTree * tree = new TTree("tree", "tree");
unsigned long long evID = 0;
int multi = 0;