Skip to content
Open
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
5 changes: 5 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@
"name": "Xarepe, Manuel",
"orcid": "0000-0003-1966-2234",
"affiliation": "Faculty of Science of the University of Lisbon, 1749-016 Lisboa, Portugal"
},
{
"name": "Duer, Meytal",
"orcid": "0000-0002-4241-1938",
"affiliation": "GSI Helmholtzzentrum für Schwerionenforschung, 64291 Darmstadt, Germany"
}
],
"contributors": [
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Audouin, Laurent [laurent.audouin@ijclab.in2p3.fr] [https://orcid.org/0000-0001-
Barriere, Antoine [https://orcid.org/0009-0005-2204-3516] [GANIL, 14000 Caen, France]
Bott, Lukas [https://orcid.org/0000-0002-9554-6246] [Goethe University Frankfurt, 60629 Frankfurt am Main, Germany]
Chatillon, Audrey [CEA, DAM, DIF, 91297 Arpajon, France]
Duer, Meytal [https://orcid.org/0000-0002-4241-1938] [GSI Helmholtzzentrum für Schwerionenforschung, 64291 Darmstadt, Germany]
Feijoo-Fontán, Martina [https://orcid.org/0000-0002-8507-5137] [IGFAE, University of Santiago de Compostela, 15782 Santiago de Compostela, Spain]
García-Jiménez, Gabriel [https://orcid.org/0000-0002-4435-0163] [IGFAE, University of Santiago de Compostela, 15782 Santiago de Compostela, Spain]
Gasparic, Igor [https://orcid.org/0000-0002-5022-3312] [RBI Zagreb, HR10000 Zagreb, Croatia]
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ if(NOT MODULE)
add_subdirectory(evtvis)
add_subdirectory(psp)
add_subdirectory(rpc)
add_subdirectory(pw)
add_subdirectory(alpide)
add_subdirectory(mwpc)
add_subdirectory(twim)
Expand Down
6 changes: 6 additions & 0 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,12 @@
"email": "mrunmoy.jena@tum.de",
"affiliation": "Technische Universit\u00e4t M\u00fcnchen, 85748 Garching, Germany",
"identifier": "https://orcid.org/0000-0003-1199-5181"
},
{
"@type": "Person",
"givenName": "Meytal",
"familyName": "Duer",
"affiliation": "GSI Helmholtzzentrum f\u00fcr Schwerionenforschung, 64291 Darmstadt, Germany"
}
],
"contributor": [
Expand Down
56 changes: 56 additions & 0 deletions pw/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
##############################################################################
# Copyright (C) 2022 GSI Helmholtzzentrum für Schwerionenforschung GmbH #
# Copyright (C) 2022-2025 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. #
##############################################################################

set(SRCS
pars/R3BPWContFact.cxx
calibration/R3BPWMapped2PreCalPar.cxx
calibration/R3BPWMapped2PreCal.cxx
calibration/R3BPWPreCal2CalPar.cxx
calibration/R3BPWPreCal2Cal.cxx
pars/R3BPWTotCalPar.cxx
calibration/R3BPWCal2Hit.cxx
calibration/R3BPWCal2HitPar.cxx
pars/R3BPWHitPar.cxx
online/R3BPWOnlineSpectra.cxx
)
set(HEADERS
pars/R3BPWContFact.h
calibration/R3BPWMapped2PreCalPar.h
calibration/R3BPWMapped2PreCal.h
calibration/R3BPWPreCal2CalPar.h
calibration/R3BPWPreCal2Cal.h
pars/R3BPWTotCalPar.h
calibration/R3BPWCal2Hit.h
calibration/R3BPWCal2HitPar.h
pars/R3BPWHitPar.h
online/R3BPWOnlineSpectra.h
)
add_library_with_dictionary(
LIBNAME
R3BPW
LINKDEF
PWLinkDef.h
HEADERS
${HEADERS}
SRCS
${SRCS}
INCLUDEDIRS
${CMAKE_CURRENT_SOURCE_DIR}
calibration
online
pars
DEPENDENCIES
R3BTracking
R3BTCal)


37 changes: 37 additions & 0 deletions pw/PWLinkDef.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// clang-format off

/******************************************************************************
* Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
* Copyright (C) 2019-2025 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. *
******************************************************************************/

#ifdef __CINT__

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

#pragma link C++ class R3BPWContFact;

#pragma link C++ class R3BPWMapped2PreCalPar+;
#pragma link C++ class R3BPWMapped2PreCal+;

#pragma link C++ class R3BPWPreCal2CalPar+;
#pragma link C++ class R3BPWPreCal2Cal+;
#pragma link C++ class R3BPWTotCalPar+;

#pragma link C++ class R3BPWCal2Hit+;
#pragma link C++ class R3BPWCal2HitPar+;
#pragma link C++ class R3BPWHitPar+;

#pragma link C++ class R3BPWOnlineSpectra+;

#endif
147 changes: 147 additions & 0 deletions pw/calibration/R3BPWCal2Hit.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
/******************************************************************************
* Copyright (C) 2026 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
* Copyright (C) 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. *
******************************************************************************/

#include "R3BPWCal2Hit.h"
#include "TClonesArray.h"
#include "TMath.h"
#include "TObjArray.h"
#include "TRandom.h"

#include "FairLogger.h"
#include "FairRootManager.h"
#include "FairRunAna.h"
#include "FairRuntimeDb.h"

#include "TGeoManager.h"
#include "TGeoMatrix.h"

#include "R3BPWCalData.h"
#include <list>
#include <vector>

R3BPWCal2Hit::R3BPWCal2Hit()
: FairTask("R3B PW Cal to Hit")
{
}

R3BPWCal2Hit::~R3BPWCal2Hit()
{
LOG(info) << "R3BPWCal2Hit: Delete instance";
if (fPWHitDataCA)
delete fPWHitDataCA;
}

InitStatus R3BPWCal2Hit::Init()
{

// Parameter Container
// Reading PWHitPar from FairRuntimeDb
FairRuntimeDb* rtdb = FairRuntimeDb::instance();
if (!rtdb)
{
LOG(error) << "R3BPWCal2Hit:: FairRuntimeDb not opened";
}

FairRootManager* rootManager = FairRootManager::Instance();
if (!rootManager)
{
LOG(fatal) << "R3BPWCal2Hit::FairRootManager not found";
return kFATAL;
}

fHitPar = dynamic_cast<R3BPWHitPar*>(rtdb->getContainer("PWHitPar"));
if (!fHitPar)
{
LOG(error) << "R3BPWCal2Hit::Init() Couldn't get handle on PWHitPar container";
}
else
{
LOG(info) << "R3BPWCal2Hit:: PWHitPar container open";
}

fPWCalDataCA = dynamic_cast<TClonesArray*>(rootManager->GetObject("R3BPWCalData"));
if (!fPWCalDataCA)
{
LOG(error) << "R3BPWCal2HitPar::Init() R3BPWCalData not found";
return kFATAL;
}

// Register output array
fPWHitDataCA = new TClonesArray("R3BPWHitData");
rootManager->Register("R3BPWHitData", "PW Bar Hit", fPWHitDataCA, !fOnline);

fParCont = fHitPar->GetCalParams();

return kSUCCESS;
}

InitStatus R3BPWCal2Hit::ReInit()
{
SetParContainers();
return kSUCCESS;
}

void R3BPWCal2Hit::Exec(Option_t* opt)
{
Reset();
// loop over si data
Int_t nHits = fPWCalDataCA->GetEntriesFast();
UInt_t iDetector = 0;
double charge_left = -1000;
double charge_right = -1000;
double time_left = 0;
double time_right = 0;
UInt_t ibar = 0;

for (Int_t i = 0; i < nHits; i++)
{
auto map1 = dynamic_cast<R3BPWCalData*>(fPWCalDataCA->At(i));
iDetector = map1->GetDetId();

if (iDetector == 0)
{
charge_right = map1->GetTot0();
time_right = map1->GetTime0();
ibar = map1->GetChannelId();

charge_left = map1->GetTot1();
time_left = map1->GetTime1();

double position = double(ibar - 1) * (2.3 + 0.2) - 6.35; // relative to pad plane coordinates
double charge = (charge_left + charge_right) / 2.;
double time = (time_left + time_right) / 2. + fParCont->GetAt(ibar - 1);

auto tof = time; // will be later relative to start (diamond)
AddHitBar(iDetector, ibar, time, position, charge, tof);
}
}
}

R3BPWHitData* R3BPWCal2Hit::AddHitBar(UInt_t detId, UInt_t channel, double time, double pos, double charge, double tof)
{

TClonesArray& clref = *fPWHitDataCA;
Int_t size = clref.GetEntriesFast();
return new (clref[size]) R3BPWHitData(detId, channel, time, pos, charge, tof);
}

void R3BPWCal2Hit::Reset()
{
LOG(debug) << "Clearing PWHitStructure Structure";
if (fPWHitDataCA)
{
fPWHitDataCA->Clear();
}
}

ClassImp(R3BPWCal2Hit);
60 changes: 60 additions & 0 deletions pw/calibration/R3BPWCal2Hit.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/******************************************************************************
* Copyright (C) 2026 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
* Copyright (C) 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. *
******************************************************************************/

#pragma once

#include "FairTask.h"
#include "R3BPWHitData.h"
#include "R3BPWHitPar.h"
#include "Rtypes.h"

class TClonesArray;
class R3BTGeoPar;

class R3BPWCal2Hit : public FairTask
{

public:
/** Default constructor **/
R3BPWCal2Hit();

/** Destructor **/
~R3BPWCal2Hit() override;

/** Virtual method Exec **/
void Exec(Option_t* opt) override;

/** Virtual method Reset **/
virtual void Reset();

/** Accessor to select online mode **/
void SetOnline(bool option = true) { fOnline = option; }

/** Virtual method Init **/
InitStatus Init() override;

/** Virtual method ReInit **/
InitStatus ReInit() override;

private:
TArrayF* fParCont = nullptr;
TClonesArray* fPWCalDataCA = nullptr;
TClonesArray* fPWHitDataCA = nullptr;
Bool_t fOnline = false; // Selector for online data storage
R3BPWHitPar* fHitPar; // Parameter class

R3BPWHitData* AddHitBar(UInt_t iDet, UInt_t bar, double time, double pos, double charge, double tof);

public:
ClassDefOverride(R3BPWCal2Hit, 1);
};
Loading
Loading