Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 29 additions & 27 deletions sofdata/tofwData/R3BSofTofWPoint.cxx
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
/******************************************************************************
* Copyright (C) 2017 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
* Copyright (C) 2017-2026 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. *
******************************************************************************/

// -------------------------------------------------------------------------
// ----- R3BSofTofWPoint source file -----
// -------------------------------------------------------------------------
Expand All @@ -8,31 +21,27 @@

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

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

// ----- Standard constructor ------------------------------------------
R3BSofTofWPoint::R3BSofTofWPoint(Int_t trackID,
Int_t detID,
Int_t detCopyID,
Double_t Z,
Double_t A,
R3BSofTofWPoint::R3BSofTofWPoint(int trackID,
int detID,
int detCopyID,
double Z,
double A,
TVector3 posIn,
TVector3 posOut,
TVector3 momIn,
TVector3 momOut,
Double_t tof,
Double_t length,
Double_t eLoss)
double tof,
double length,
double eLoss)
: FairMCPoint(trackID, detID, posIn, momIn, tof, length, eLoss)
{
fDetCopyID = detCopyID;
Expand All @@ -45,16 +54,11 @@ R3BSofTofWPoint::R3BSofTofWPoint(Int_t trackID,
fZFF = Z;
fAFF = A;
}
// -------------------------------------------------------------------------

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

// ----- Public method Print -------------------------------------------
void R3BSofTofWPoint::Print(const Option_t* opt) const
void R3BSofTofWPoint::Print(const Option_t*) const
{
cout << "-I- R3BSofTofWPoint: STS Point for track " << fTrackID << " in detector " << fDetectorID << endl;
cout << "R3BSofTofWPoint: 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"
Expand All @@ -63,31 +67,29 @@ void R3BSofTofWPoint::Print(const Option_t* opt) const
// -------------------------------------------------------------------------

// ----- Point x coordinate from linear extrapolation ------------------
Double_t R3BSofTofWPoint::GetX(Double_t z) const
double R3BSofTofWPoint::GetX(double 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;
double dz = fZ_out - fZ;
return (fX + (z - fZ) / dz * (fX_out - fX));
}
// -------------------------------------------------------------------------

// ----- Point y coordinate from linear extrapolation ------------------
Double_t R3BSofTofWPoint::GetY(Double_t z) const
double R3BSofTofWPoint::GetY(double 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.;
double dz = fZ_out - fZ;
return (fY + (z - fZ) / dz * (fY_out - fY));
}
// -------------------------------------------------------------------------

// ----- Public method IsUsable ----------------------------------------
Bool_t R3BSofTofWPoint::IsUsable() const
bool R3BSofTofWPoint::IsUsable() const
{
Double_t dz = fZ_out - fZ;
double dz = fZ_out - fZ;
if (TMath::Abs(dz) < 1.e-4)
return kFALSE;
return kTRUE;
Expand Down
97 changes: 52 additions & 45 deletions sofdata/tofwData/R3BSofTofWPoint.h
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
/******************************************************************************
* Copyright (C) 2017 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
* Copyright (C) 2017-2026 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. *
******************************************************************************/

// -------------------------------------------------------------------------
// ----- R3BSofTofWPoint header file -----
// ----- Created 06/12/17 by JL Rodriguez -----
// ----- R3BSofTofWPoint header file -----
// ----- Created 06/12/17 by J.L. Rodriguez-Sanchez -----
// -------------------------------------------------------------------------

/** R3BSofTofWPoint.h
**/

#ifndef R3BSofTofWPoint_H
#define R3BSofTofWPoint_H
#pragma once

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

class R3BSofTofWPoint : public FairMCPoint
{

public:
/** Default constructor **/
R3BSofTofWPoint();
Expand All @@ -34,65 +42,66 @@ class R3BSofTofWPoint : public FairMCPoint
*@param length Track length since creation [cm]
*@param eLoss Energy deposit [GeV]
**/
R3BSofTofWPoint(Int_t trackID,
Int_t detID,
Int_t detCopyID,
Double_t Z,
Double_t A,
R3BSofTofWPoint(int trackID,
int detID,
int detCopyID,
double Z,
double A,
TVector3 posIn,
TVector3 posOut,
TVector3 momIn,
TVector3 momOut,
Double_t tof,
Double_t length,
Double_t eLoss);
double tof,
double length,
double eLoss);

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

/** Destructor **/
virtual ~R3BSofTofWPoint();
virtual ~R3BSofTofWPoint() = default;

/** 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; }
int GetDetCopyID() const { return fDetCopyID; }
double GetXIn() const { return fX; }
double GetYIn() const { return fY; }
double GetZIn() const { return fZ; }
double GetXOut() const { return fX_out; }
double GetYOut() const { return fY_out; }
double GetZOut() const { return fZ_out; }
double GetPxOut() const { return fPx_out; }
double GetPyOut() const { return fPy_out; }
double GetPzOut() const { return fPz_out; }
double GetZFF() const { return fZFF; }
double GetAFF() const { return fAFF; }

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;
double GetX(double z) const;
double GetY(double z) const;

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

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

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

protected:
Double32_t fX_out, fY_out, fZ_out;
Double32_t fPx_out, fPy_out, fPz_out;
Int_t fDetCopyID;
Double32_t fZFF, fAFF;
private:
double fX_out = 0., fY_out = 0., fZ_out = 0.;
double fPx_out = 0., fPy_out = 0., fPz_out = 0.;
int fDetCopyID = 0;
double fZFF = 0., fAFF = 0.;

ClassDef(R3BSofTofWPoint, 1)
public:
ClassDef(R3BSofTofWPoint, 1);
};

inline void R3BSofTofWPoint::SetPositionOut(TVector3 pos)
Expand All @@ -108,5 +117,3 @@ inline void R3BSofTofWPoint::SetMomentumOut(TVector3 mom)
fPy_out = mom.Py();
fPz_out = mom.Pz();
}

#endif
7 changes: 2 additions & 5 deletions tofwall/calibration/R3BSofTofWMapped2Tcal.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
// *** ---> from the fine and coarse times, calculate a raw time in ns *** //
// *** *************************************************************** *** //

#ifndef R3BSOFTOFW_MAPPED2TCAL_H
#define R3BSOFTOFW_MAPPED2TCAL_H
#pragma once

#include "FairTask.h"
#include "R3BSofTofWTcalData.h"
Expand Down Expand Up @@ -65,7 +64,5 @@ class R3BSofTofWMapped2Tcal : public FairTask
R3BSofTofWTcalData* AddTCalData(UShort_t detector, UShort_t pmt, Double_t t);

public:
ClassDef(R3BSofTofWMapped2Tcal, 1)
ClassDef(R3BSofTofWMapped2Tcal, 1);
};

#endif // R3BSOFTOFW_MAPPED2TCAL_H
9 changes: 3 additions & 6 deletions tofwall/calibration/R3BSofTofWMapped2TcalPar.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#ifndef R3BSOFTOFWMAPPED2TCALPAR_H
#define R3BSOFTOFWMAPPED2TCALPAR_H
#pragma once

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

class TClonesArray;
class R3BSofTcalPar;
Expand Down Expand Up @@ -72,5 +71,3 @@ class R3BSofTofWMapped2TcalPar : public FairTask
public:
ClassDef(R3BSofTofWMapped2TcalPar, 0);
};

#endif // R3BSOFTOFWMAPPED2TCALPAR_H
7 changes: 2 additions & 5 deletions tofwall/calibration/R3BSofTofWTcal2SingleTcal.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
// *** R3BSofTofWTcal2SingleTcal
// *** ***************************************************************

#ifndef R3BSOFTOFW_TCAL2SINGLETCAL_H
#define R3BSOFTOFW_TCAL2SINGLETCAL_H 1
#pragma once

#include "FairTask.h"
#include "R3BSofSciRawTofPar.h"
Expand Down Expand Up @@ -65,7 +64,5 @@ class R3BSofTofWTcal2SingleTcal : public FairTask
R3BSofTofWSingleTcalData* AddHitData(Int_t plastic, Double_t time, Double_t tof, Double_t pos);

public:
ClassDef(R3BSofTofWTcal2SingleTcal, 1)
ClassDef(R3BSofTofWTcal2SingleTcal, 1);
};

#endif // R3BSOFTOFW_TCAL2SINGLETCAL_H
Loading