Skip to content
Snippets Groups Projects
Commit efec815a authored by Theodore Efremov's avatar Theodore Efremov :hibiscus:
Browse files

Started working on toff

parent 985389c3
No related branches found
No related tags found
1 merge request!27Draft: [Epic] Preparation of the environement for the new GaseousDetectorScorers...
Pipeline #370642 passed
#include "TTimeData.h"
#include <TChain.h>
#include <TH2.h>
using namespace std;
void ToffGenerator( ){
//===========================================================================================================
// Setters
//===========================================================================================================
TChain* chain = new TChain("PhysicsTree");
chain->Add("../../../root/analysis/VamosCalib247.root");
Int_t FPMW_Section , M13 , M14, M23, M24 ;// we will fetch multiplicity during
// the getentry
TTimeData *Time;
chain->SetBranchStatus("FPMW_Section", true);
chain->SetBranchAddress("FPMW_Section", &FPMW_Section);
chain->SetBranchStatus("Time", true);
chain->SetBranchAddress("Time", &Time);
//===========================================================================================================
// Histograms
//===========================================================================================================
TH2F *hToff13 = new TH2F("Toff13","Toff13", 20, 0, 20, 100, -50, 50);
TH2F *hToff14 = new TH2F("Toff14","Toff14", 20, 0, 20, 100, -50, 50);
TH2F *hToff23 = new TH2F("Toff23","Toff23", 20, 0, 20, 100, -50, 50);
TH2F *hToff24 = new TH2F("Toff24","Toff24", 20, 0, 20, 100, -50, 50);
//===========================================================================================================
// Loop on entries
//===========================================================================================================
int Nentries = chain->GetEntries();
//int Nentries = 10000000;
auto start = std::chrono::high_resolution_clock::now();
for (int e = 0; e < Nentries; e++) {
if (e % 100000 == 0 && e > 0 ) {
auto now = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> elapsed = now - start;
double avgTimePerIteration = elapsed.count() / e;
double timeLeft = avgTimePerIteration * (Nentries - e);
std::cout << "********** Estimated time left: " << int(timeLeft) << " seconds **********" << "\r" << flush;
}
M13 = Time->GetMWPC13Mult();
M14 = Time->GetMWPC14Mult();
M23 = Time->GetMWPC23Mult();
M24 = Time->GetMWPC24Mult();
if (M13 == 2 && (FPMW_Section)){
//hToff13->Fill()
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment