|
@@ -25,10 +25,6 @@ void UserTaskWrite::Init() { // Preparations before reading events
|
|
|
particles_ = chain->GetBranch("McTracks");
|
|
|
particles_.Freeze();
|
|
|
|
|
|
- AddInputBranch("FHCalModules");
|
|
|
- fhcal_mods_ = chain->GetBranch("FHCalModules");
|
|
|
- fhcal_mods_.Freeze();
|
|
|
-
|
|
|
match_ = chain->GetMatching("TpcTracks", "McTracks");
|
|
|
|
|
|
// Set up branch configurations (copy them from the input and then modify)
|
|
@@ -47,10 +43,6 @@ void UserTaskWrite::Init() { // Preparations before reading events
|
|
|
new_conf_particles.AddFields<bool>({"is_charged"}, "Extended parameter");
|
|
|
new_conf_particles.AddFields<int>({"eta_sign"}, "Extended parameter");
|
|
|
|
|
|
- auto br_conf_fhcal_mods = chain->GetConfiguration()->GetBranchConfig("FHCalModules");
|
|
|
- auto new_conf_fhcal_mods = br_conf_fhcal_mods.Clone("FHCalModulesExt", DetType::kModule);
|
|
|
- new_conf_fhcal_mods.AddFields<float>({"phi", "signal_eta_signed"}, "Extended parameter");
|
|
|
-
|
|
|
// Prepare output branches and then add them to the output file via task manager
|
|
|
new_reco_evt_ = Branch(new_conf_reco_evt);
|
|
|
new_reco_evt_.SetMutable();
|
|
@@ -58,13 +50,10 @@ void UserTaskWrite::Init() { // Preparations before reading events
|
|
|
new_tracks_.SetMutable();
|
|
|
new_particles_ = Branch(new_conf_particles);
|
|
|
new_particles_.SetMutable();
|
|
|
- new_fhcal_mods_ = Branch(new_conf_fhcal_mods);
|
|
|
- new_fhcal_mods_.SetMutable();
|
|
|
|
|
|
man->AddBranch(&new_reco_evt_);
|
|
|
man->AddBranch(&new_tracks_);
|
|
|
man->AddBranch(&new_particles_);
|
|
|
- man->AddBranch(&new_fhcal_mods_);
|
|
|
}
|
|
|
|
|
|
void UserTaskWrite::Exec() { // Procedures to do iside loop over events
|
|
@@ -99,12 +88,6 @@ void UserTaskWrite::Exec() { // Procedures to do iside loop over events
|
|
|
auto imc_particle_is_charged = new_particles_.GetField("is_charged");
|
|
|
auto imc_particle_eta_sign = new_particles_.GetField("eta_sign");
|
|
|
|
|
|
- // Get links to variables from the input and output FHCal modules
|
|
|
- auto ifhcal_signal = fhcal_mods_.GetField("signal");
|
|
|
- auto ifhcal_number = fhcal_mods_.GetField("number");
|
|
|
- auto ifhcal_mods_phi = new_fhcal_mods_.GetField("phi");
|
|
|
- auto ifhcal_mods_signal_eta_signed = new_fhcal_mods_.GetField("signal_eta_signed");
|
|
|
-
|
|
|
// Processing reco & mc event
|
|
|
for(size_t i=0; i<1; ++i){
|
|
|
auto mc_evt_var = mc_evt_[i];
|
|
@@ -157,27 +140,12 @@ void UserTaskWrite::Exec() { // Procedures to do iside loop over events
|
|
|
new_particle.SetValue(imc_particle_eta_sign, mc_eta_sign);
|
|
|
new_particle.SetValue(imc_particle_is_charged, is_charged);
|
|
|
}
|
|
|
-
|
|
|
- // Processing FHCal modules
|
|
|
- new_fhcal_mods_.ClearChannels();
|
|
|
- for(size_t i=0; i<fhcal_mods_.size(); ++i){ // Loop over FHCal modules
|
|
|
- auto fhcal_mod = fhcal_mods_[i];
|
|
|
- auto new_fhcal_mod = new_fhcal_mods_.NewChannel();
|
|
|
- new_fhcal_mod.CopyContent(fhcal_mod);
|
|
|
-
|
|
|
- double phi_mod = GetFHCalPhi((int)fhcal_mod.Value(ifhcal_number));
|
|
|
- new_fhcal_mod.SetValue(ifhcal_mods_phi, phi_mod);
|
|
|
-
|
|
|
- float fhcal_sign = ((int)fhcal_mod.Value(ifhcal_number) < 45) ? -1. : 1.;
|
|
|
- new_fhcal_mod.SetValue(ifhcal_mods_signal_eta_signed, fhcal_sign*fhcal_mod.Value(ifhcal_signal));
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
UserTaskWrite::~UserTaskWrite() { // Destructor. Make sure to delete branch pointers for each output branch
|
|
|
delete new_reco_evt_ptr_;
|
|
|
delete new_particles_ptr_;
|
|
|
delete new_tracks_ptr_;
|
|
|
- delete new_fhcal_mods_ptr_;
|
|
|
}
|
|
|
|
|
|
bool UserTaskWrite::IsCharged(Int_t pdg) { // Additional function returning bool value wheather the particle is charged or not
|
|
@@ -217,29 +185,3 @@ float UserTaskWrite::GetBCent(Float_t bimp) { // Additional function returning c
|
|
|
}
|
|
|
return cent;
|
|
|
}
|
|
|
-
|
|
|
-float UserTaskWrite::GetFHCalPhi(int iModule) { // Additional function returning azimuthal angle of the center of i-th FHCal module
|
|
|
- const int Nmodules = 45;
|
|
|
- int xAxisSwitch = (iModule < Nmodules) ? 1 : -1;
|
|
|
- int module = (iModule < Nmodules) ? iModule : iModule - Nmodules;
|
|
|
- float x, y, phi = -999.;
|
|
|
- if (module >= 0 && module <= 4)
|
|
|
- {
|
|
|
- y = 45.;
|
|
|
- x = (module - 2) * 15.;
|
|
|
- phi = TMath::ATan2(y, x * xAxisSwitch);
|
|
|
- }
|
|
|
- else if ((module >= 5) && (module <= 39))
|
|
|
- {
|
|
|
- y = (3 - (module + 2) / 7) * 15.;
|
|
|
- x = (3 - (module + 2) % 7) * 15.;
|
|
|
- phi = TMath::ATan2(y, x * xAxisSwitch);
|
|
|
- }
|
|
|
- else if ((module >= 40) && (module <= 44))
|
|
|
- {
|
|
|
- y = -45.;
|
|
|
- x = (module - 42) * 15.;
|
|
|
- phi = TMath::ATan2(y, x * xAxisSwitch);
|
|
|
- }
|
|
|
- return phi;
|
|
|
-}
|