Skip to content

Commit c73cd70

Browse files
committed
Add plastic wall for HYDRA
1 parent 00d3faf commit c73cd70

42 files changed

Lines changed: 3388 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ if(NOT MODULE)
576576
add_subdirectory(evtvis)
577577
add_subdirectory(psp)
578578
add_subdirectory(rpc)
579+
add_subdirectory(pw)
579580
add_subdirectory(alpide)
580581
add_subdirectory(mwpc)
581582
add_subdirectory(twim)

pw/CMakeLists.txt

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
##############################################################################
2+
# Copyright (C) 2022 GSI Helmholtzzentrum für Schwerionenforschung GmbH #
3+
# Copyright (C) 2022-2025 Members of R3B Collaboration #
4+
# #
5+
# This software is distributed under the terms of the #
6+
# GNU General Public Licence (GPL) version 3, #
7+
# copied verbatim in the file "LICENSE". #
8+
# #
9+
# In applying this license GSI does not waive the privileges and immunities #
10+
# granted to it by virtue of its status as an Intergovernmental Organization #
11+
# or submit itself to any jurisdiction. #
12+
##############################################################################
13+
14+
set(SRCS
15+
pars/R3BPWContFact.cxx
16+
calibration/R3BPWMapped2PreCalPar.cxx
17+
calibration/R3BPWMapped2PreCal.cxx
18+
calibration/R3BPWPreCal2CalPar.cxx
19+
calibration/R3BPWPreCal2Cal.cxx
20+
pars/R3BPWTotCalPar.cxx
21+
calibration/R3BPWCal2Hit.cxx
22+
calibration/R3BPWCal2HitPar.cxx
23+
pars/R3BPWHitPar.cxx
24+
online/R3BPWOnlineSpectra.cxx
25+
)
26+
set(HEADERS
27+
pars/R3BPWContFact.h
28+
calibration/R3BPWMapped2PreCalPar.h
29+
calibration/R3BPWMapped2PreCal.h
30+
calibration/R3BPWPreCal2CalPar.h
31+
calibration/R3BPWPreCal2Cal.h
32+
pars/R3BPWTotCalPar.h
33+
calibration/R3BPWCal2Hit.h
34+
calibration/R3BPWCal2HitPar.h
35+
pars/R3BPWHitPar.h
36+
online/R3BPWOnlineSpectra.h
37+
)
38+
add_library_with_dictionary(
39+
LIBNAME
40+
R3BPW
41+
LINKDEF
42+
PWLinkDef.h
43+
HEADERS
44+
${HEADERS}
45+
SRCS
46+
${SRCS}
47+
INCLUDEDIRS
48+
${CMAKE_CURRENT_SOURCE_DIR}
49+
calibration
50+
online
51+
pars
52+
DEPENDENCIES
53+
R3BTracking
54+
R3BTCal)
55+
56+

pw/PWLinkDef.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// clang-format off
2+
3+
/******************************************************************************
4+
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
5+
* Copyright (C) 2019-2025 Members of R3B Collaboration *
6+
* *
7+
* This software is distributed under the terms of the *
8+
* GNU General Public Licence (GPL) version 3, *
9+
* copied verbatim in the file "LICENSE". *
10+
* *
11+
* In applying this license GSI does not waive the privileges and immunities *
12+
* granted to it by virtue of its status as an Intergovernmental Organization *
13+
* or submit itself to any jurisdiction. *
14+
******************************************************************************/
15+
16+
#ifdef __CINT__
17+
18+
#pragma link off all globals;
19+
#pragma link off all classes;
20+
#pragma link off all functions;
21+
22+
#pragma link C++ class R3BPWContFact;
23+
24+
#pragma link C++ class R3BPWMapped2PreCalPar+;
25+
#pragma link C++ class R3BPWMapped2PreCal+;
26+
27+
#pragma link C++ class R3BPWPreCal2CalPar+;
28+
#pragma link C++ class R3BPWPreCal2Cal+;
29+
#pragma link C++ class R3BPWTotCalPar+;
30+
31+
#pragma link C++ class R3BPWCal2Hit+;
32+
#pragma link C++ class R3BPWCal2HitPar+;
33+
#pragma link C++ class R3BPWHitPar+;
34+
35+
#pragma link C++ class R3BPWOnlineSpectra+;
36+
37+
#endif
16 KB
Binary file not shown.

pw/calibration/R3BPWCal2Hit.cxx

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
/******************************************************************************
2+
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3+
* Copyright (C) 2019-2025 Members of R3B Collaboration *
4+
* *
5+
* This software is distributed under the terms of the *
6+
* GNU General Public Licence (GPL) version 3, *
7+
* copied verbatim in the file "LICENSE". *
8+
* *
9+
* In applying this license GSI does not waive the privileges and immunities *
10+
* granted to it by virtue of its status as an Intergovernmental Organization *
11+
* or submit itself to any jurisdiction. *
12+
******************************************************************************/
13+
14+
#include "R3BPWCal2Hit.h"
15+
#include "TClonesArray.h"
16+
#include "TMath.h"
17+
#include "TObjArray.h"
18+
#include "TRandom.h"
19+
20+
#include "FairLogger.h"
21+
#include "FairRootManager.h"
22+
#include "FairRunAna.h"
23+
#include "FairRuntimeDb.h"
24+
25+
#include "TGeoManager.h"
26+
#include "TGeoMatrix.h"
27+
28+
#include "R3BPWCalData.h"
29+
#include <list>
30+
#include <vector>
31+
32+
R3BPWCal2Hit::R3BPWCal2Hit()
33+
: FairTask("R3B PW Cal to Hit")
34+
, fParCont(NULL)
35+
, fPWCalDataCA(NULL)
36+
, fPWHitDataCA(NULL)
37+
, fOnline(kFALSE)
38+
{
39+
}
40+
41+
R3BPWCal2Hit::~R3BPWCal2Hit()
42+
{
43+
LOG(info) << "R3BPWCal2Hit: Delete instance";
44+
if (fPWHitDataCA)
45+
delete fPWHitDataCA;
46+
}
47+
48+
void R3BPWCal2Hit::SetParContainers() {}
49+
50+
InitStatus R3BPWCal2Hit::Init()
51+
{
52+
53+
// Parameter Container
54+
// Reading PWHitPar from FairRuntimeDb
55+
FairRuntimeDb* rtdb = FairRuntimeDb::instance();
56+
if (!rtdb)
57+
{
58+
LOG(error) << "R3BPWCal2Hit:: FairRuntimeDb not opened";
59+
}
60+
61+
FairRootManager* rootManager = FairRootManager::Instance();
62+
if (!rootManager)
63+
{
64+
LOG(fatal) << "R3BPWCal2Hit::FairRootManager not found";
65+
return kFATAL;
66+
}
67+
68+
fHitPar = dynamic_cast<R3BPWHitPar*>(rtdb->getContainer("PWHitPar"));
69+
if (!fHitPar)
70+
{
71+
LOG(error) << "R3BPWCal2Hit::Init() Couldn't get handle on PWHitPar container";
72+
}
73+
else
74+
{
75+
LOG(info) << "R3BPWCal2Hit:: PWHitPar container open";
76+
}
77+
78+
fPWCalDataCA = dynamic_cast<TClonesArray*>(rootManager->GetObject("R3BPWCalData"));
79+
if (!fPWCalDataCA)
80+
{
81+
LOG(error) << "R3BPWCal2HitPar::Init() R3BPWCalData not found";
82+
return kFATAL;
83+
}
84+
85+
// Register output array
86+
fPWHitDataCA = new TClonesArray("R3BPWHitData");
87+
rootManager->Register("R3BPWHitData", "PW Bar Hit", fPWHitDataCA, !fOnline);
88+
89+
fParCont = fHitPar->GetCalParams();
90+
91+
return kSUCCESS;
92+
}
93+
94+
InitStatus R3BPWCal2Hit::ReInit()
95+
{
96+
SetParContainers();
97+
return kSUCCESS;
98+
}
99+
100+
void R3BPWCal2Hit::Exec(Option_t* opt)
101+
{
102+
Reset();
103+
// loop over si data
104+
Int_t nHits = fPWCalDataCA->GetEntries();
105+
UInt_t iDetector = 0;
106+
double charge_left = -1000;
107+
double charge_right = -1000;
108+
double time_left = 0;
109+
double time_right = 0;
110+
UInt_t ibar = 0;
111+
112+
for (Int_t i = 0; i < nHits; i++)
113+
{
114+
auto map1 = dynamic_cast<R3BPWCalData*>(fPWCalDataCA->At(i));
115+
iDetector = map1->GetDetId();
116+
117+
if (iDetector == 0)
118+
{
119+
charge_right = map1->GetTot0();
120+
time_right = map1->GetTime0();
121+
ibar = map1->GetChannelId();
122+
123+
charge_left = map1->GetTot1();
124+
time_left = map1->GetTime1();
125+
126+
double position = double(ibar - 1) * (2.3 + 0.2) - 6.35; // relative to pad plane coordinates
127+
double charge = (charge_left + charge_right) / 2.;
128+
double time = (time_left + time_right) / 2. + fParCont->GetAt(ibar - 1);
129+
130+
auto tof = time; // will be later relative to start (diamond)
131+
AddHitBar(iDetector, ibar, time, position, charge, tof);
132+
}
133+
}
134+
}
135+
136+
R3BPWHitData* R3BPWCal2Hit::AddHitBar(UInt_t detId, UInt_t channel, double time, double pos, double charge, double tof)
137+
{
138+
139+
TClonesArray& clref = *fPWHitDataCA;
140+
Int_t size = clref.GetEntriesFast();
141+
return new (clref[size]) R3BPWHitData(detId, channel, time, pos, charge, tof);
142+
}
143+
144+
void R3BPWCal2Hit::Reset()
145+
{
146+
LOG(debug) << "Clearing PWHitStructure Structure";
147+
if (fPWHitDataCA)
148+
{
149+
fPWHitDataCA->Clear();
150+
}
151+
}
152+
153+
ClassImp(R3BPWCal2Hit);

pw/calibration/R3BPWCal2Hit.h

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/******************************************************************************
2+
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3+
* Copyright (C) 2019-2025 Members of R3B Collaboration *
4+
* *
5+
* This software is distributed under the terms of the *
6+
* GNU General Public Licence (GPL) version 3, *
7+
* copied verbatim in the file "LICENSE". *
8+
* *
9+
* In applying this license GSI does not waive the privileges and immunities *
10+
* granted to it by virtue of its status as an Intergovernmental Organization *
11+
* or submit itself to any jurisdiction. *
12+
******************************************************************************/
13+
14+
#pragma once
15+
16+
#include "FairTask.h"
17+
#include "R3BPWHitData.h"
18+
#include "R3BPWHitPar.h"
19+
#include "Rtypes.h"
20+
21+
class TClonesArray;
22+
class R3BTGeoPar;
23+
24+
class R3BPWCal2Hit : public FairTask
25+
{
26+
27+
public:
28+
/** Default constructor **/
29+
R3BPWCal2Hit();
30+
31+
/** Destructor **/
32+
~R3BPWCal2Hit() override;
33+
34+
/** Virtual method Exec **/
35+
void Exec(Option_t* opt) override;
36+
37+
/** Virtual method Reset **/
38+
virtual void Reset();
39+
40+
/** Virtual method SetParContainers **/
41+
void SetParContainers() override;
42+
43+
/** Accessor to select online mode **/
44+
inline void SetOnline(Bool_t option) { fOnline = option; }
45+
46+
/** Virtual method Init **/
47+
InitStatus Init() override;
48+
49+
/** Virtual method ReInit **/
50+
InitStatus ReInit() override;
51+
52+
private:
53+
TArrayF* fParCont;
54+
TClonesArray* fPWCalDataCA;
55+
TClonesArray* fPWHitDataCA;
56+
Bool_t fOnline; // Selector for online data storage
57+
R3BPWHitPar* fHitPar; // Parameter class
58+
59+
R3BPWHitData* AddHitBar(UInt_t iDet, UInt_t bar, double time, double pos, double charge, double tof);
60+
61+
public:
62+
ClassDefOverride(R3BPWCal2Hit, 1);
63+
};

0 commit comments

Comments
 (0)