| ATTPCROOT
    0.3.0-alpha
    A ROOT-based framework for analyzing data from active target detectors | 
 
 
 
Go to the documentation of this file.
    9 #include <FairLogger.h>       
   10 #include <FairRootManager.h>  
   13 #include <TClonesArray.h>  
   26      fRawEvent(
AtViewerManager::Instance()->GetRawEventBranch()), fFissionEvent(fissionBranch),
 
   29    fStacks[0] = std::make_unique<THStack>(
"hFF1", 
"FF 1");
 
   30    fStacks[2] = std::make_unique<THStack>(
"hFF2", 
"FF 2");
 
   31    fStacks[1] = std::make_unique<THStack>(
"hExp", 
"Experimental dE/dX curves");
 
   33       fStacks[3] = std::make_unique<THStack>(
"hSim", 
"Experimental ADC Sum");
 
   35       fStacks[3] = std::make_unique<THStack>(
"hSim", 
"Simulated dE/dX curves");
 
   37    std::array<Color_t, 2> colors = {9, 31};
 
   38    for (
int i = 0; i < 2; ++i) {
 
   39       fSimdQdZ[i] = std::make_unique<TH1F>(TString::Format(
"sim%d", i), TString::Format(
"Sim FF %d", i), 512, 0, 512);
 
   40       fExpdQdZ[i] = std::make_unique<TH1F>(TString::Format(
"exp%d", i), TString::Format(
"Exp FF %d", i), 512, 0, 512);
 
   42          std::make_unique<TH1F>(TString::Format(
"expADC%d", i), TString::Format(
"Exp FF ADC Sum %d", i), 512, 0, 512);
 
   90    for (
int i = 0; i < 2; ++i) {
 
   91       std::vector<double> exp;
 
   92       std::vector<double> sim;
 
   93       std::vector<double> adcSum;
 
   99       LOG(info) << 
"Good hits " << goodHits;
 
  111       auto fResultArray = 
dynamic_cast<TClonesArray *
>(FairRootManager::Instance()->GetObject(
"AtMCResult"));
 
  114          fSimdQdZ[i]->Scale(result->fParameters[
"Amp"]);
 
  116             LOG(info) << 
"Z1: " << result->fParameters[
"Z0"] << 
" A1: " << result->fParameters[
"A0"];
 
  117             LOG(info) << 
"Z2: " << result->fParameters[
"Z1"] << 
" A2: " << result->fParameters[
"A1"];
 
  118             LOG(info) << 
"ObjQ: " << result->fParameters[
"ObjQ"] << 
" ObjPos: " << result->fParameters[
"ObjPos"]
 
  119                       << 
" Amp: " << result->fParameters[
"Amp"];
 
  120             bool inCut = result->fParameters[
"ObjQ"] < 15 && result->fParameters[
"Amp"] < 0.5;
 
  121             LOG(info) << std::endl << (inCut ? 
"In Cut" : 
"Out Cut") << std::endl;
 
  130    for (
int i = 0; i < 4; ++i) {
 
  134          fSimdQdZ[i / 2]->SetLineColor(kRed);
 
  135          fExpdQdZ[i / 2]->SetLineColor(kBlue);
 
  136          fStacks[i]->Draw(
"nostack;hist");
 
  140          fStacks[i]->Draw(
"nostack;hist");
 
  144          fStacks[i]->Draw(
"nostack;hist");
 
  
AtTabInfoFairRoot< AtEvent > fEvent
void Update(DataHandling::AtSubject *sub) override
Subject for the branch in the FairRoot tree.
AtTabInfoFairRoot< AtFissionEvent > fFissionEvent
std::array< TH1Ptr, 2 > fExpdQdZ
void Detach(AtObserver *observer)
Detach an observer to stop getting notified when this subject changes.
static AtViewerManager * Instance()
AtTabInfoFairRoot< AtRawEvent > fRawEvent
AtTabFF(DataHandling::AtBranch &fissionBranch, bool plotADC=false)
DataHandling::AtTreeEntry & fEntry
const HitVector & GetHits() const
DataHandling::AtBranch & GetEventBranch()
std::vector< T * > GetPointerVector(const std::vector< T > &vec)
void SetHistFromData(TH1 &hist, const T &data, double xMin=0, double xMax=0)
Use contents of data to set the bin contents of hist.
std::vector< AtHit * > GetFragmentHits(AtEvent *event)
Abstract class for a tab composed of a single TCanvas.
std::array< TH1Ptr, 2 > fExpADCSum
void Attach(AtObserver *observer)
Attach an observer to get notified when this subject changes.
static int FillHitSums(std::vector< double > &exp, std::vector< double > &sim, const std::vector< AtHit * > &expHits, const std::vector< AtHit * > &simHits, int threshold=0, float saturationThreshold=std::numeric_limits< float >::max(), const AtDigiPar *par=nullptr, std::vector< double > *expADC=nullptr, AtRawEvent *expEvent=nullptr)
std::array< TH1Ptr, 2 > fSimdQdZ
std::array< THStackPtr, 4 > fStacks
static double fSatThreshold
std::vector< AtHit * > GetFragHits() const