Skip to content

Commit

Permalink
Minor update for CALIFA simulation classes
Browse files Browse the repository at this point in the history
Minor change

Added include TArray.h in calibration/R3BCalifaMapped2CrystalCalPar.h

Added include TArray.h in calibration/R3BCalifaMapped2CrystalCalPar.h

Added include TArrayF.h in calibration/R3BCalifaMapped2CrystalCalPar.h

Added include TArrayF.h in calibration/R3BCalifaMapped2CrystalCal.h

Update R3BCalifa class for simulation and related classes

Minor change

Minor change in r3bcalifa

Check compilation

Almost ready the new implementation

Minor change

Minor update

Added final IOConnector for output data

Added final IOConnector for output data

Minor changes

Clang-format

Clang-format

Minor change

Minor change

Minor change

Minor change

Minor change

Minor change

Minor change

Minor change in R3BCalifaCrystalCal2Cluster.cxx

Use of TObject for R3BCalifaClusterData
  • Loading branch information
jose-luis-rs committed Jan 6, 2024
1 parent 494f869 commit 0d878c8
Show file tree
Hide file tree
Showing 22 changed files with 442 additions and 555 deletions.
2 changes: 2 additions & 0 deletions califa/CalifaLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class vector<R3BCalifaCrystalCalData>+;

#pragma link C++ class R3BCalifaContFact;
#pragma link C++ class R3BCalifaClusterPar+;
#pragma link C++ class R3BCalifaMappingPar+;
Expand Down
22 changes: 11 additions & 11 deletions califa/calibration/R3BCalifaCrystalCal2Cluster.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,8 @@ R3BCalifaCrystalCal2Cluster::R3BCalifaCrystalCal2Cluster()
, fCrystalCalData(NULL)
, fCalifaClusterData(NULL)
, fGeometryVersion(2021)
, fCrystalThreshold(100.)
, fGammaClusterThreshold(1000)
, fProtonClusterThreshold(50000)
, fCrystalThreshold(0)
, fGammaClusterThreshold(0)
, fRoundWindow(0.25)
, fSimulation(kFALSE)
, fCalifaGeo(NULL)
Expand All @@ -173,9 +172,10 @@ R3BCalifaCrystalCal2Cluster::~R3BCalifaCrystalCal2Cluster()
void R3BCalifaCrystalCal2Cluster::SetParContainers()
{
FairRuntimeDb* rtdb = FairRuntimeDb::instance();
R3BLOG_IF(fatal, !rtdb, "FairRuntimeDb not found");

fCalifaGeoPar = (R3BTGeoPar*)rtdb->getContainer("CalifaGeoPar");
fTargetGeoPar = (R3BTGeoPar*)rtdb->getContainer("TargetGeoPar");
fCalifaGeoPar = dynamic_cast<R3BTGeoPar*>(rtdb->getContainer("CalifaGeoPar"));
fTargetGeoPar = dynamic_cast<R3BTGeoPar*>(rtdb->getContainer("TargetGeoPar"));

if (!fCalifaGeoPar)
{
Expand Down Expand Up @@ -213,15 +213,15 @@ InitStatus R3BCalifaCrystalCal2Cluster::Init()
{
R3BLOG(info, "");
assert(!fCalifaClusterData); // in case someone calls Init() twice.
SetParContainers();
SetParContainers(); // TODO: This should not be here!!!

FairRootManager* ioManager = FairRootManager::Instance();
R3BLOG_IF(fatal, !ioManager, "FairRootManager not found");
auto* rootman = FairRootManager::Instance();
R3BLOG_IF(fatal, !rootman, "FairRootManager not found");

fCrystalCalData = (TClonesArray*)ioManager->GetObject("CalifaCrystalCalData");
fCrystalCalData = dynamic_cast<TClonesArray*>(rootman->GetObject("CalifaCrystalCalData"));

fCalifaClusterData = new TClonesArray("R3BCalifaClusterData");
ioManager->Register("CalifaClusterData", "CALIFA Cluster", fCalifaClusterData, !fOnline);
rootman->Register("CalifaClusterData", "CALIFA Cluster", fCalifaClusterData, !fOnline);

fCalifaGeo = R3BCalifaGeometry::Instance();

Expand Down Expand Up @@ -260,7 +260,7 @@ void R3BCalifaCrystalCal2Cluster::Exec(Option_t* opt)
{
Reset();

const int numCrystalHits = fCrystalCalData->GetEntries();
const int numCrystalHits = fCrystalCalData->GetEntriesFast();

R3BLOG(debug1, "Crystal hits at start:" << numCrystalHits);

Expand Down
13 changes: 8 additions & 5 deletions califa/calibration/R3BCalifaCrystalCal2Cluster.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
* Copyright (C) 2019-2023 Members of R3B Collaboration *
* Copyright (C) 2019-2024 Members of R3B Collaboration *
* *
* This software is distributed under the terms of the *
* GNU General Public Licence (GPL) version 3, *
Expand All @@ -11,6 +11,8 @@
* or submit itself to any jurisdiction. *
******************************************************************************/

#pragma once

#ifndef R3BCALIFACRYSTALCAL2CLUSTER_H
#define R3BCALIFACRYSTALCAL2CLUSTER_H 1

Expand Down Expand Up @@ -96,10 +98,11 @@ class R3BCalifaCrystalCal2Cluster : public FairTask
Int_t fGeometryVersion; // Selecting the geometry of the CALIFA calorimeter
Int_t fTotalCrystals;

Double_t fCrystalThreshold; // Minimum energy requested in a crystal to be included in a cluster
Double_t fProtonClusterThreshold; // Minimum energy in a crystal to be considered as a proton cluster candidate
Double_t fGammaClusterThreshold; // Minimum energy in a crystal to be considered as a gamma cluster candidate
Double_t fProtonThreshold; // Defines the cut energy between proton and gamma readout
Double_t fCrystalThreshold; // Minimum energy requested in a crystal to be included in a cluster
Double_t fProtonClusterThreshold =
50.; // Minimum energy in a crystal to be considered as a proton cluster candidate
Double_t fGammaClusterThreshold; // Minimum energy in a crystal to be considered as a gamma cluster candidate
Double_t fProtonThreshold; // Defines the cut energy between proton and gamma readout

Double_t fRoundWindow; // Cluster window
Bool_t fSimulation; // Simulation flag
Expand Down
4 changes: 2 additions & 2 deletions califa/calibration/R3BCalifaCrystalCal2CrystalCalPID.cxx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
* Copyright (C) 2019-2023 Members of R3B Collaboration *
* Copyright (C) 2019-2024 Members of R3B Collaboration *
* *
* This software is distributed under the terms of the *
* GNU General Public Licence (GPL) version 3, *
Expand All @@ -18,9 +18,9 @@
#include "FairRootManager.h"
#include "FairRunAna.h"
#include "FairRuntimeDb.h"

#include <fstream>
#include <iomanip>
#include <iostream>

#include "R3BCalifaCrystalCal2CrystalCalPID.h"
#include "R3BCalifaCrystalCalData.h"
Expand Down
4 changes: 3 additions & 1 deletion califa/calibration/R3BCalifaCrystalCal2CrystalCalPID.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
* Copyright (C) 2019-2023 Members of R3B Collaboration *
* Copyright (C) 2019-2024 Members of R3B Collaboration *
* *
* This software is distributed under the terms of the *
* GNU General Public Licence (GPL) version 3, *
Expand All @@ -11,6 +11,8 @@
* or submit itself to any jurisdiction. *
******************************************************************************/

#pragma once

#ifndef R3BCalifaCrystalCal2CrystalCalPID_H
#define R3BCalifaCrystalCal2CrystalCalPID_H

Expand Down
4 changes: 2 additions & 2 deletions califa/calibration/R3BCalifaCrystalCal2TotCalPar.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ void R3BCalifaCrystalCal2TotCalPar::Exec(Option_t* opt)
// Fill histograms
if (CalHit[i]->GetEnergy() > fThreshold)
energy_vs_tot_crystal[crystalId - 1]->SetPoint(
energy_vs_tot_crystal[crystalId - 1]->GetN(), CalHit[i]->GetToT_Energy(), CalHit[i]->GetEnergy());
LOG(debug) << "Tot = " << CalHit[i]->GetToT_Energy();
energy_vs_tot_crystal[crystalId - 1]->GetN(), CalHit[i]->GetToTEnergy(), CalHit[i]->GetEnergy());
LOG(debug) << "Tot = " << CalHit[i]->GetToTEnergy();
LOG(debug) << "Energy = " << CalHit[i]->GetEnergy();
}

Expand Down
12 changes: 7 additions & 5 deletions califa/calibration/R3BCalifaCrystalCal2TotCalPar.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
* Copyright (C) 2019-2023 Members of R3B Collaboration *
* Copyright (C) 2019-2024 Members of R3B Collaboration *
* *
* This software is distributed under the terms of the *
* GNU General Public Licence (GPL) version 3, *
Expand All @@ -11,12 +11,14 @@
* or submit itself to any jurisdiction. *
******************************************************************************/

#pragma once

#ifndef R3BCalifaCrystalCal2TotCalPar_H
#define R3BCalifaCrystalCal2TotCalPar_H
#define R3BCalifaCrystalCal2TotCalPar_H 1

#include "FairTask.h"
#include "TGraph.h"
#include "TH1F.h"
#include <FairTask.h>
#include <TGraph.h>
#include <TH1F.h>

class TClonesArray;
class R3BCalifaMappingPar;
Expand Down
7 changes: 5 additions & 2 deletions califa/calibration/R3BCalifaMapped2CrystalCal.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/******************************************************************************
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
* Copyright (C) 2019-2023 Members of R3B Collaboration *
* Copyright (C) 2019-2024 Members of R3B Collaboration *
* *
* This software is distributed under the terms of the *
* GNU General Public Licence (GPL) version 3, *
Expand All @@ -20,14 +20,17 @@
// ----- -----
// -----------------------------------------------------------------------------

#pragma once

#ifndef R3BCALIFAMAPPED2CRYSTALCAL_H
#define R3BCALIFAMAPPED2CRYSTALCAL_H
#define R3BCALIFAMAPPED2CRYSTALCAL_H 1

#include "FairTask.h"

#include "R3BCalifaCrystalCalData.h"
#include "R3BCalifaMappedData.h"

#include <TArrayF.h>
#include <TRandom.h>

class TClonesArray;
Expand Down
9 changes: 6 additions & 3 deletions califa/calibration/R3BCalifaMapped2CrystalCalPar.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@
* or submit itself to any jurisdiction. *
******************************************************************************/

#pragma once

#ifndef R3BCALIFAMAPPED2CRYSTALCALPAR_H
#define R3BCALIFAMAPPED2CRYSTALCALPAR_H
#define R3BCALIFAMAPPED2CRYSTALCALPAR_H 1

#include "FairTask.h"
#include "TH1F.h"
#include <FairTask.h>
#include <TArrayF.h>
#include <TH1F.h>

class TClonesArray;
class R3BCalifaMappingPar;
Expand Down
Loading

0 comments on commit 0d878c8

Please sign in to comment.