Skip to content

Commit

Permalink
new asyreader and online spectra
Browse files Browse the repository at this point in the history
  • Loading branch information
pcget committed Feb 19, 2024
1 parent 10afa3c commit 85265b9
Show file tree
Hide file tree
Showing 31 changed files with 2,080 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ if(WITH_UCESB)
add_subdirectory(asysource)
endif(WITH_UCESB)
add_subdirectory(chimera)
add_subdirectory(krab)
add_subdirectory(asydata)
add_subdirectory(asyonline)
4 changes: 4 additions & 0 deletions asydata/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ${R3BROOT_SOURCE_DIR}/r3bdata/califaData
${R3BROOT_SOURCE_DIR}/r3bdata/neulandData
${R3BASY_SOURCE_DIR}/asydata
${R3BASY_SOURCE_DIR}/asydata/chimeraData
${R3BASY_SOURCE_DIR}/asydata/krabData
)

include_directories( ${INCLUDE_DIRECTORIES})
Expand All @@ -22,6 +23,9 @@ link_directories( ${LINK_DIRECTORIES})
set(SRCS
chimeraData/R3BAsyChimeraPoint.cxx
chimeraData/R3BAsyChimeraHitData.cxx
chimeraData/R3BAsyChimeraMappedData.cxx
krabData/R3BAsyKrabPoint.cxx
krabData/R3BAsyKrabHitData.cxx
)


Expand Down
4 changes: 3 additions & 1 deletion asydata/R3BAsyDataLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@
// Point classes for simulation
#pragma link C++ class R3BAsyChimeraPoint+;
#pragma link C++ class R3BAsyChimeraHitData+;

#pragma link C++ class R3BAsyChimeraMappedData+;
#pragma link C++ class R3BAsyKrabPoint+;
#pragma link C++ class R3BAsyKrabHitData+;
#endif
48 changes: 48 additions & 0 deletions asydata/chimeraData/R3BAsyChimeraMappedData.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/******************************************************************************
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
* Copyright (C) 2019-2024 Members of R3B Collaboration *
* *
* This software is distributed under the terms of the *
* GNU General Public Licence (GPL) version 3, *
* copied verbatim in the file "LICENSE". *
* *
* In applying this license GSI does not waive the privileges and immunities *
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
******************************************************************************/

#include "R3BAsyChimeraMappedData.h"

R3BAsyChimeraMappedData::R3BAsyChimeraMappedData()
: fDetector(-1)
, fSide(-1)
, fStrip(-1)
, fEnergy(-1)
, fTime(-1)
{
}

R3BAsyChimeraMappedData::R3BAsyChimeraMappedData(UInt_t detector,
UInt_t side,
UInt_t strip,
UInt_t energy,
UInt_t time)
: fDetector(detector)
, fSide(side)
, fStrip(strip)
, fEnergy(energy)
, fTime(time)
{
}

UInt_t R3BAsyChimeraMappedData::GetDetectorId() const { return fDetector; }

UInt_t R3BAsyChimeraMappedData::GetSideId() const { return fSide; }

UInt_t R3BAsyChimeraMappedData::GetStripId() const { return fStrip; }

UInt_t R3BAsyChimeraMappedData::GetEnergy() const { return fEnergy; }

UInt_t R3BAsyChimeraMappedData::GetTime() const { return fTime; }

ClassImp(R3BAsyChimeraMappedData)
42 changes: 42 additions & 0 deletions asydata/chimeraData/R3BAsyChimeraMappedData.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/******************************************************************************
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
* Copyright (C) 2019-2024 Members of R3B Collaboration *
* *
* This software is distributed under the terms of the *
* GNU General Public Licence (GPL) version 3, *
* copied verbatim in the file "LICENSE". *
* *
* In applying this license GSI does not waive the privileges and immunities *
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
******************************************************************************/

#ifndef R3BASYCHIMERAMAPPEDITEM_H
#define R3BASYCHIMERAMAPPEDITEM_H

#include "TObject.h"

class R3BAsyChimeraMappedData : public TObject
{
public:
R3BAsyChimeraMappedData();
R3BAsyChimeraMappedData(UInt_t, UInt_t, UInt_t, UInt_t, UInt_t);

UInt_t GetDetectorId() const;
UInt_t GetSideId() const;
UInt_t GetStripId() const;
UInt_t GetEnergy() const;
UInt_t GetTime() const;

private:
UInt_t fDetector; // 1..n
UInt_t fSide; // 1 = front, 2 = back
UInt_t fStrip; // 0..31
UInt_t fEnergy;
UInt_t fTime;

public:
ClassDef(R3BAsyChimeraMappedData, 1)
};

#endif
17 changes: 17 additions & 0 deletions asydata/krabData/R3BAsyKrabHitData.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ---------------------------------------------------------------------------
// ----- R3BAsyKrabHitData source file ------
// ---------------------------------------------------------------------------

#include "R3BAsyKrabHitData.h"

// ----- Default constructor -------------------------------------------
R3BAsyKrabHitData::R3BAsyKrabHitData()
: fCellId(0), fELoss(0.), fLight(0.), fToF(0.) {}

// ----- Standard constructor ------------------------------------------
R3BAsyKrabHitData::R3BAsyKrabHitData(Int_t ncell, Double_t eloss,
Double_t light, Double_t tof)
: fCellId(ncell), fELoss(eloss), fLight(light), fToF(tof) {}
// -------------------------------------------------------------------------

ClassImp(R3BAsyKrabHitData)
45 changes: 45 additions & 0 deletions asydata/krabData/R3BAsyKrabHitData.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// -------------------------------------------------------------------
// ----- R3BAsyKrabHitData header file ------
// ----- Created 24/10/23 by E. De Filippo and P. Russotto ------
// -------------------------------------------------------------------

#ifndef R3BAsyKrabHitData_H
#define R3BAsyKrabHitData_H
#include "TObject.h"

class R3BAsyKrabHitData : public TObject {
public:
/** Default constructor **/
R3BAsyKrabHitData();

/** Constructor with arguments
*@param fCellId Cell number
*@param fEloss Energy Loss in [MeV]
*@param fLight Light in arb. units
*@param fToF Tof in [ns]
**/
R3BAsyKrabHitData(Int_t CellId, Double_t ELoss, Double_t Light, Double_t ToF);

/** Destructor **/
virtual ~R3BAsyKrabHitData() {}

/** Accessors **/
Int_t GetCellId() const { return fCellId; }
Double_t GetEloss() const { return fELoss; }
Double_t GetLight() const { return fLight; }
Double_t GetToF() const { return fToF; }

/** Modifiers **/
void SetCellID(Int_t ncell) { fCellId = ncell; };
void SetELoss(Double_t eloss) { fELoss = eloss; };
void SetLight(Double_t light) { fLight = light; };
void SetTof(Double_t t) { fToF = t; };

private:
Int_t fCellId;
Double_t fELoss, fLight, fToF;

ClassDef(R3BAsyKrabHitData, 1)
};

#endif
85 changes: 85 additions & 0 deletions asydata/krabData/R3BAsyKrabPoint.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// --------------------------------------------------------------------------
// ----- R3BAsyKrabPoint source file ------
// --------------------------------------------------------------------------

#include "R3BAsyKrabPoint.h"

#include <iostream>

using std::cout;
using std::endl;
using std::flush;

// ----- Default constructor -------------------------------------------
R3BAsyKrabPoint::R3BAsyKrabPoint() : FairMCPoint() {
fX_out = fY_out = fZ_out = 0.;
fPx_out = fPy_out = fPz_out = 0.;
fZFF = fAFF = 0.;
}
// -------------------------------------------------------------------------

// ----- Standard constructor ------------------------------------------
R3BAsyKrabPoint::R3BAsyKrabPoint(Int_t trackID, Int_t detID, Int_t detCopyID,
Double_t Z, Double_t A, TVector3 posIn,
TVector3 posOut, TVector3 momIn,
TVector3 momOut, Double_t tof, Double_t length,
Double_t eLoss, Double_t lightYield)
: FairMCPoint(trackID, detID, posIn, momIn, tof, length, eLoss) {
fDetCopyID = detCopyID;
fX_out = posOut.X();
fY_out = posOut.Y();
fZ_out = posOut.Z();
fPx_out = momOut.Px();
fPy_out = momOut.Py();
fPz_out = momOut.Pz();
fZFF = Z;
fAFF = A;
fLightYield = lightYield;
}
// -------------------------------------------------------------------------

// ----- Destructor ----------------------------------------------------
R3BAsyKrabPoint::~R3BAsyKrabPoint() {}
// -------------------------------------------------------------------------

// ----- Public method Print -------------------------------------------
// void R3BAsyKrabPoint::Print(const Option_t* opt) const
//{
// cout << "-I- R3BAsyKrabPoint: STS Point for track " << fTrackID << " in
// detector " << fDetectorID << endl; cout << " Position (" << fX << ", "
// << fY << ", " << fZ << ") cm" << endl; cout << " Momentum (" << fPx <<
// ", " << fPy << ", " << fPz << ") GeV" << endl; cout << " Time " <<
// fTime << " ns, Length " << fLength << " cm, Energy loss " << fELoss
// * 1.0e06 << " keV"; cout << " lightYield " << fLightYield * 1.0e03 << "
// MeVeq"
// << endl;
//}
// -------------------------------------------------------------------------

// ----- Point x coordinate from linear extrapolation ------------------
Double_t R3BAsyKrabPoint::GetX(Double_t z) const {
// cout << fZ << " " << z << " " << fZ_out << endl;
if ((fZ_out - z) * (fZ - z) >= 0.) return (fX_out + fX) / 2.;
Double_t dz = fZ_out - fZ;
return (fX + (z - fZ) / dz * (fX_out - fX));
}
// -------------------------------------------------------------------------

// ----- Point y coordinate from linear extrapolation ------------------
Double_t R3BAsyKrabPoint::GetY(Double_t z) const {
if ((fZ_out - z) * (fZ - z) >= 0.) return (fY_out + fY) / 2.;
Double_t dz = fZ_out - fZ;
// if ( TMath::Abs(dz) < 1.e-3 ) return (fY_out+fY)/2.;
return (fY + (z - fZ) / dz * (fY_out - fY));
}
// -------------------------------------------------------------------------

// ----- Public method IsUsable ----------------------------------------
Bool_t R3BAsyKrabPoint::IsUsable() const {
Double_t dz = fZ_out - fZ;
if (TMath::Abs(dz) < 1.e-4) return kFALSE;
return kTRUE;
}
// -------------------------------------------------------------------------

ClassImp(R3BAsyKrabPoint)
102 changes: 102 additions & 0 deletions asydata/krabData/R3BAsyKrabPoint.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// --------------------------------------------------------------------------
// ----- R3BAsyKrabPoint header file ------
// ----- Created 24/10/23 by E. De Filippo and P. Russotto ------
// --------------------------------------------------------------------------

/** R3BAsyKrabPoint.h
**/

#ifndef R3BAsyKrabPoint_H
#define R3BAsyKrabPoint_H

#include "FairMCPoint.h"
#include "TObject.h"
#include "TVector3.h"

class R3BAsyKrabPoint : public FairMCPoint {
public:
/** Default constructor **/
R3BAsyKrabPoint();

/** Constructor with arguments
*@param trackID Index of MCTrack
*@param detID Detector ID
*@param detVolID Detector Copy ID
*@param Z Atomic number fragment
*@param A Mass number fragment
*@param posIn Ccoordinates at entrance to active volume [cm]
*@param posOut Coordinates at exit of active volume [cm]
*@param momIn Momentum of track at entrance [GeV]
*@param momOut Momentum of track at exit [GeV]
*@param tof Time since event start [ns]
*@param length Track length since creation [cm]
*@param eLoss Energy deposit [GeV]
**/
R3BAsyKrabPoint(Int_t trackID, Int_t detID, Int_t detCopyID, Double_t Z,
Double_t A, TVector3 posIn, TVector3 posOut, TVector3 momIn,
TVector3 momOut, Double_t tof, Double_t length,
Double_t eLoss, Double_t lightYield);

/** Copy constructor **/
R3BAsyKrabPoint(const R3BAsyKrabPoint& point) { *this = point; };

/** Destructor **/
virtual ~R3BAsyKrabPoint();

/** Accessors **/
Int_t GetDetCopyID() const { return fDetCopyID; }
Double_t GetXIn() const { return fX; }
Double_t GetYIn() const { return fY; }
Double_t GetZIn() const { return fZ; }
Double_t GetXOut() const { return fX_out; }
Double_t GetYOut() const { return fY_out; }
Double_t GetZOut() const { return fZ_out; }
Double_t GetPxOut() const { return fPx_out; }
Double_t GetPyOut() const { return fPy_out; }
Double_t GetPzOut() const { return fPz_out; }
Double_t GetZFF() const { return fZFF; }
Double_t GetAFF() const { return fAFF; }
Double_t GetLightYield() const { return fLightYield; }

void PositionIn(TVector3& pos) { pos.SetXYZ(fX, fY, fZ); }
void PositionOut(TVector3& pos) { pos.SetXYZ(fX_out, fY_out, fZ_out); }
void MomentumOut(TVector3& mom) { mom.SetXYZ(fPx_out, fPy_out, fPz_out); }

/** Point coordinates at given z from linear extrapolation **/
Double_t GetX(Double_t z) const;
Double_t GetY(Double_t z) const;

/** Check for distance between in and out **/
Bool_t IsUsable() const;

/** Modifiers **/
void SetPositionOut(TVector3 pos);
void SetMomentumOut(TVector3 mom);
void SetDetCopyID(Int_t id) { fDetCopyID = id; };

/** Output to screen **/
// virtual void Print(const Option_t* opt) const;

private:
Double32_t fX_out, fY_out, fZ_out;
Double32_t fPx_out, fPy_out, fPz_out;
Int_t fDetCopyID;
Double32_t fZFF, fAFF;
Double_t fLightYield;

ClassDef(R3BAsyKrabPoint, 1)
};

inline void R3BAsyKrabPoint::SetPositionOut(TVector3 pos) {
fX_out = pos.X();
fY_out = pos.Y();
fZ_out = pos.Z();
}

inline void R3BAsyKrabPoint::SetMomentumOut(TVector3 mom) {
fPx_out = mom.Px();
fPy_out = mom.Py();
fPz_out = mom.Pz();
}

#endif
9 changes: 9 additions & 0 deletions asyonline/AsyOnlineLinkDef.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#ifdef __CINT__

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class R3BAsyChimeraOnlineSpectra+;

#endif
Loading

0 comments on commit 85265b9

Please sign in to comment.