Commit 631c1eb1 authored by Daniel Wielanek's avatar Daniel Wielanek Committed by Florian Uhlig
Browse files

Nicafemto

parent d8071d9f
......@@ -28,17 +28,11 @@ set(NICA_CBM_FORMAT
${CBMDATA_DIR}/mvd
${NICA_CBM}/format
${NICA_CBM}/format/combined
${NICA_CBM}/format/full
${NICA_CBM}/format/global
${NICA_CBM}/format/matched
${NICA_CBM}/format/mc
${NICA_CBM}/format/anatree
${NICA_CBM}/format/anatree/reco
${NICA_CBM}/format/anatree/mc
${NICA_CBM}/format/anatree/femto
${NICA_CBM}/format/unigen
${NICA_CBM}/format/hits
${NICA_CBM}/format/matched_hits
)
set(NICAFEMTO_CUTS
......
......@@ -11,13 +11,8 @@ ${NICA_CBM_FORMAT}
${KF_HEADERS}
${NICA_CBM}/helpers
${NICA_CBM}/cuts
${NICA_CBM}/cuts/rawcuts/trackcuts
${NICA_CBM}/cuts/rawcuts/paircuts
${NICA_CBM}/cuts/rawcuts
${NICA_CBM}/cuts/commoncuts/pair
${NICA_CBM}/cuts/commoncuts/track
${NICA_CBM}/cuts/anatreecuts/pair
${NICA_CBM}/cuts/anatreecuts/track
${NICA_CBM}/cuts/pair
${NICA_CBM}/cuts/track
)
Set(SYSTEM_INCLUDE_DIRECTORIES
......@@ -41,21 +36,14 @@ Link_Directories(${LINK_DIRECTORIES})
# List of source files
set(SRCS
rawcuts/paircuts/CbmAvXYCut.cxx
rawcuts/paircuts/CbmSailorCowboyCut.cxx
rawcuts/trackcuts/CbmHasTofTrackCut.cxx
rawcuts/trackcuts/CbmMCPointsCuts.cxx
rawcuts/trackcuts/CbmStsFarDetectorHit.cxx
rawcuts/trackcuts/CbmStsStationsCut.cxx
rawcuts/trackcuts/CbmStsTrackHitsCut.cxx
rawcuts/trackcuts/CbmTofTrackCuts.cxx
commoncuts/pair/CbmDeltaPhiDeltaThetaCut.cxx
commoncuts/pair/CbmStsExitSepCut.cxx
commoncuts/track/CbmTofM2PolyCut.cxx
anatreecuts/pair/CbmBasicFemtoPairCut.cxx
anatreecuts/track/CbmBasicTrackCuts.cxx
anatreecuts/track/CbmNHitsCut.cxx
anatreecuts/track/CbmTofCut.cxx
pair/CbmBasicFemtoPairCut.cxx
pair/CbmDeltaPhiDeltaThetaCut.cxx
pair/CbmStsExitSepCut.cxx
track/CbmBasicTrackCuts.cxx
track/CbmNHitsCut.cxx
track/CbmTofCut.cxx
track/CbmTofM2PolyCut.cxx
)
Set(HEADERS )
......
......@@ -2,28 +2,9 @@
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class CbmStsTrackHitsCut + ;
#pragma link C++ class CbmTofM2PolyCut + ;
#pragma link C++ class NicaCbmMCPointsCut + ;
#pragma link C++ class NicaCbmStsPointsCut + ;
#pragma link C++ class NicaCbmMvdPointsCut + ;
#pragma link C++ class NicaCbmRichPointsCut + ;
#pragma link C++ class NicaCbmMuchPointsCut + ;
#pragma link C++ class NicaCbmTrdPointsCut + ;
#pragma link C++ class NicaCbmTofPointsCut + ;
#pragma link C++ class NicaCbmEcalPointsCut + ;
#pragma link C++ class NicaCbmPsdPointsCut + ;
#pragma link C++ class CbmTofTrackCuts + ;
#pragma link C++ class CbmTofM2Cut + ;
#pragma link C++ class CbmTofMassCut + ;
#pragma link C++ class CbmStsFarDetectorHit + ;
#pragma link C++ class CbmHasTofTrackCut + ;
#pragma link C++ class CbmStsStationsCut + ;
#pragma link C++ class CbmTofM2PolyCut + ;
#pragma link C++ class CbmStsExitSepCut + ;
#pragma link C++ class CbmSailorCowboyCut + ;
#pragma link C++ class CbmAvXYCut + ;
#pragma link C++ class CbmDeltaPhiDeltaThetaStarCut + ;
#pragma link C++ class CbmDeltaPhiDeltaThetaCut + ;
......@@ -32,7 +13,3 @@
#pragma link C++ class CbmNHitsCut + ;
#pragma link C++ class CbmTofCut + ;
#pragma link C++ class CbmBasicFemtoPairCut + ;
#pragma link C++ class CbmDeltaPhiDeltaThetaStarCut + ;
#pragma link C++ class CbmDeltaPhiDeltaThetaCut + ;
#pragma link C++ class CbmStsExitSepCut + ;
......@@ -10,10 +10,12 @@
#include "CbmDeltaPhiDeltaThetaCut.h"
#include "CbmStsExitSepCut.h"
#include "NicaCutMonitorX.h"
#include "NicaCutMonitorXY.h"
CbmBasicFemtoPairCut::CbmBasicFemtoPairCut() {
CbmBasicFemtoPairCut::CbmBasicFemtoPairCut()
{
AddCut(CbmStsExitSepCut());
AddCut(CbmDeltaPhiDeltaThetaStarCut());
SetSeparationMonitorAxis(100, 0, 10);
......@@ -21,23 +23,22 @@ CbmBasicFemtoPairCut::CbmBasicFemtoPairCut() {
SetDeltaEtaStarAxis(100, -0.1, 0.1);
}
void CbmBasicFemtoPairCut::SetDeltaPhiStarCut(Double_t min, Double_t max) {
void CbmBasicFemtoPairCut::SetDeltaPhiStarCut(Double_t min, Double_t max)
{
GetDeltaPhiEtaStarCut()->SetMinMax(min, max, 0);
}
void CbmBasicFemtoPairCut::SetDeltaEtaStarCut(Double_t min, Double_t max) {
void CbmBasicFemtoPairCut::SetDeltaEtaStarCut(Double_t min, Double_t max)
{
GetDeltaPhiEtaStarCut()->SetMinMax(min, max, 1);
}
void CbmBasicFemtoPairCut::SetR(Double_t R) {
GetDeltaPhiEtaStarCut()->SetR(R);
}
void CbmBasicFemtoPairCut::SetR(Double_t R) { GetDeltaPhiEtaStarCut()->SetR(R); }
void CbmBasicFemtoPairCut::SetSTSExitSeparationCut(Double_t min, Double_t max) {
GetStsExitCut()->SetMinMax(min, max);
}
void CbmBasicFemtoPairCut::SetSTSExitSeparationCut(Double_t min, Double_t max) { GetStsExitCut()->SetMinMax(min, max); }
void CbmBasicFemtoPairCut::CreateBasicMonitors() {
void CbmBasicFemtoPairCut::CreateBasicMonitors()
{
TString opt = "";
Int_t step = 0;
TString params = GetGlobalCutOption();
......@@ -49,14 +50,10 @@ void CbmBasicFemtoPairCut::CreateBasicMonitors() {
NicaCutMonitorX exitM(GetStsExitCut()->CutName(opt), step);
exitM.SetXaxis(fExitSeparation.X(), fExitSeparation.Y(), fExitSeparation.Z());
AddCutMonitor(exitM);
NicaCutMonitorXY phiM(GetDeltaPhiEtaStarCut()->CutName(opt),
0 + step,
GetDeltaPhiEtaStarCut()->CutName(opt),
NicaCutMonitorXY phiM(GetDeltaPhiEtaStarCut()->CutName(opt), 0 + step, GetDeltaPhiEtaStarCut()->CutName(opt),
1 + step);
phiM.SetXaxis(
fMonitorPhiPair[0].X(), fMonitorPhiPair[0].Y(), fMonitorPhiPair[0].Z());
phiM.SetYaxis(
fMonitorPhiPair[1].X(), fMonitorPhiPair[1].Y(), fMonitorPhiPair[1].Z());
phiM.SetXaxis(fMonitorPhiPair[0].X(), fMonitorPhiPair[0].Y(), fMonitorPhiPair[0].Z());
phiM.SetYaxis(fMonitorPhiPair[1].X(), fMonitorPhiPair[1].Y(), fMonitorPhiPair[1].Z());
AddCutMonitor(phiM);
}
......
......@@ -9,33 +9,24 @@
#ifndef CBMBASICFEMTOPAIRCUT_H_
#define CBMBASICFEMTOPAIRCUT_H_
#include "NicaCutsAndMonitors.h"
#include <TVector3.h>
#include "NicaCutsAndMonitors.h"
class CbmStsExitSepCut;
class CbmDeltaPhiDeltaThetaStarCut;
class CbmBasicFemtoPairCut : public NicaCutsAndMonitors {
TVector3 fMonitorPhiPair[2];
TVector3 fExitSeparation;
CbmStsExitSepCut* GetStsExitCut() const {
return (CbmStsExitSepCut*) CutAt(0);
}
CbmDeltaPhiDeltaThetaStarCut* GetDeltaPhiEtaStarCut() const {
return (CbmDeltaPhiDeltaThetaStarCut*) CutAt(1);
}
CbmStsExitSepCut* GetStsExitCut() const { return (CbmStsExitSepCut*) CutAt(0); }
CbmDeltaPhiDeltaThetaStarCut* GetDeltaPhiEtaStarCut() const { return (CbmDeltaPhiDeltaThetaStarCut*) CutAt(1); }
public:
CbmBasicFemtoPairCut();
void SetSeparationMonitorAxis(Int_t nbins, Double_t min, Double_t max) {
fExitSeparation.SetXYZ(nbins, min, max);
}
void SetDeltaPhiStarAxis(Int_t bin, Double_t min, Double_t max) {
fMonitorPhiPair[0].SetXYZ(bin, min, max);
}
void SetDeltaEtaStarAxis(Int_t bin, Double_t min, Double_t max) {
fMonitorPhiPair[1].SetXYZ(bin, min, max);
}
void SetSeparationMonitorAxis(Int_t nbins, Double_t min, Double_t max) { fExitSeparation.SetXYZ(nbins, min, max); }
void SetDeltaPhiStarAxis(Int_t bin, Double_t min, Double_t max) { fMonitorPhiPair[0].SetXYZ(bin, min, max); }
void SetDeltaEtaStarAxis(Int_t bin, Double_t min, Double_t max) { fMonitorPhiPair[1].SetXYZ(bin, min, max); }
void SetDeltaPhiStarCut(Double_t min, Double_t max);
void SetDeltaEtaStarCut(Double_t min, Double_t max);
void SetR(Double_t R);
......
......@@ -11,8 +11,11 @@
#include "CbmHbtTrack.h"
#include "CbmHelix.h"
#include "NicaCbmATTrack.h"
#include "NicaCbmGlobalTrack.h"
#include <TLorentzVector.h>
#include <TVector3.h>
#include "NicaCbmTrack.h"
#include "NicaCut.h"
#include "NicaEvent.h"
#include "NicaPackage.h"
......@@ -21,28 +24,27 @@
#include "NicaTrack.h"
#include "NicaTwoTrack.h"
#include <TLorentzVector.h>
#include <TVector3.h>
CbmDeltaPhiDeltaThetaStarCut::CbmDeltaPhiDeltaThetaStarCut()
: NicaTwoTrackCut(2)
, fR(0.0)
, fDataType(NicaCbmFormats::ECbmFormatType::kUnknown) {
, fDataType(NicaCbmFormats::ECbmFormatType::kUnknown)
{
SetUnitName("#Delta#phi^{*} [rad]", 0);
SetUnitName("#Delta#eta^{*} [rad]", 1);
}
Bool_t CbmDeltaPhiDeltaThetaStarCut::Init(Int_t task_id) {
fDataType =
NicaCbmFormats::GetFormatType(task_id, ENicaFormatDepth::kBuffered);
Bool_t CbmDeltaPhiDeltaThetaStarCut::Init(Int_t task_id)
{
fDataType = NicaCbmFormats::GetFormatType(task_id, ENicaFormatDepth::kBuffered);
if (fDataType == NicaCbmFormats::ECbmFormatType::kUnknown) return kFALSE;
return kTRUE;
}
Bool_t CbmDeltaPhiDeltaThetaStarCut::Pass(NicaTwoTrack* pair) {
Bool_t CbmDeltaPhiDeltaThetaStarCut::Pass(NicaTwoTrack* pair)
{
TVector3 mom1, mom2;
switch (fDataType) {
case NicaCbmFormats::ECbmFormatType::kCbmRoot: {
case NicaCbmFormats::ECbmFormatType::kAnaTree: {
NicaCbmTrack* tr1 = static_cast<NicaCbmTrack*>(pair->GetTrack1());
NicaCbmTrack* tr2 = static_cast<NicaCbmTrack*>(pair->GetTrack2());
CbmHelix* h1 = tr1->GetHelix();
......@@ -50,14 +52,6 @@ Bool_t CbmDeltaPhiDeltaThetaStarCut::Pass(NicaTwoTrack* pair) {
h1->Eval(fR + tr1->GetEvent()->GetVertex()->Z(), mom1);
h2->Eval(fR + tr2->GetEvent()->GetVertex()->Z(), mom2);
} break;
case NicaCbmFormats::ECbmFormatType::kAnaTree: {
NicaCbmATTrack* tr1 = static_cast<NicaCbmATTrack*>(pair->GetTrack1());
NicaCbmATTrack* tr2 = static_cast<NicaCbmATTrack*>(pair->GetTrack2());
CbmHelix* h1 = tr1->GetHelix();
CbmHelix* h2 = tr2->GetHelix();
h1->Eval(fR + tr1->GetEvent()->GetVertex()->Z(), mom1);
h2->Eval(fR + tr2->GetEvent()->GetVertex()->Z(), mom2);
} break;
case NicaCbmFormats::ECbmFormatType::kHbt: {
CbmHbtTrack* tr1 = static_cast<CbmHbtTrack*>(pair->GetTrack1());
CbmHbtTrack* tr2 = static_cast<CbmHbtTrack*>(pair->GetTrack2());
......@@ -73,21 +67,21 @@ Bool_t CbmDeltaPhiDeltaThetaStarCut::Pass(NicaTwoTrack* pair) {
SetValue(mom1.Phi() - mom2.Phi(), 0); //dleta phi
SetValue(mom1.Theta() - mom2.Theta(), 1);
if (GetValue(0) > GetMin(0) && GetValue(0) < GetMax(0)
&& GetValue(1) > GetMin(1) && GetValue(1) < GetMax(1)) {
if (GetValue(0) > GetMin(0) && GetValue(0) < GetMax(0) && GetValue(1) > GetMin(1) && GetValue(1) < GetMax(1)) {
return ForcedUpdate(kFALSE);
}
return ForcedUpdate(kTRUE);
}
NicaPackage* CbmDeltaPhiDeltaThetaStarCut::Report() const {
NicaPackage* CbmDeltaPhiDeltaThetaStarCut::Report() const
{
NicaPackage* pack = NicaTwoTrackCut::Report();
pack->AddObject(new NicaParameterDouble("R", fR));
return pack;
}
CbmDeltaPhiDeltaThetaStarCut& CbmDeltaPhiDeltaThetaStarCut::
operator=(const CbmDeltaPhiDeltaThetaStarCut& other) {
CbmDeltaPhiDeltaThetaStarCut& CbmDeltaPhiDeltaThetaStarCut::operator=(const CbmDeltaPhiDeltaThetaStarCut& other)
{
if (this == &other) return *this;
fDataType = other.fDataType;
return *this;
......@@ -95,20 +89,21 @@ operator=(const CbmDeltaPhiDeltaThetaStarCut& other) {
CbmDeltaPhiDeltaThetaStarCut::~CbmDeltaPhiDeltaThetaStarCut() {}
CbmDeltaPhiDeltaThetaCut::CbmDeltaPhiDeltaThetaCut() : NicaTwoTrackCut(2) {
CbmDeltaPhiDeltaThetaCut::CbmDeltaPhiDeltaThetaCut() : NicaTwoTrackCut(2)
{
SetUnitName("#Delta#phi [rad]", 0);
SetUnitName("#Delta#eta [rad]", 1);
}
Bool_t CbmDeltaPhiDeltaThetaCut::Init(Int_t /*task_id*/) { return kTRUE; }
Bool_t CbmDeltaPhiDeltaThetaCut::Pass(NicaTwoTrack* pair) {
NicaCbmTrack* tr1 = static_cast<NicaCbmTrack*>(pair->GetTrack1());
NicaCbmTrack* tr2 = static_cast<NicaCbmTrack*>(pair->GetTrack2());
Bool_t CbmDeltaPhiDeltaThetaCut::Pass(NicaTwoTrack* pair)
{
NicaTrack* tr1 = static_cast<NicaTrack*>(pair->GetTrack1());
NicaTrack* tr2 = static_cast<NicaTrack*>(pair->GetTrack2());
SetValue(tr1->GetMomentum()->Phi() - tr2->GetMomentum()->Phi(), 0);
SetValue(tr1->GetMomentum()->Theta() - tr2->GetMomentum()->Theta(), 1);
if (GetValue(0) > GetMin(0) && GetValue(0) < GetMax(0)
&& GetValue(1) > GetMin(1) && GetValue(1) < GetMax(1)) {
if (GetValue(0) > GetMin(0) && GetValue(0) < GetMax(0) && GetValue(1) > GetMin(1) && GetValue(1) < GetMax(1)) {
return ForcedUpdate(kFALSE);
}
return ForcedUpdate(kTRUE);
......
......@@ -9,7 +9,6 @@
#ifndef CBMDELTAPHIDELTATHETACUT_H_
#define CBMDELTAPHIDELTATHETACUT_H_
#include "NicaCbmFormatTypes.h"
#include "NicaCbmTrack.h"
#include "NicaTwoTrackCut.h"
class CbmDeltaPhiDeltaThetaStarCut : public NicaTwoTrackCut {
......@@ -18,8 +17,7 @@ class CbmDeltaPhiDeltaThetaStarCut : public NicaTwoTrackCut {
public:
CbmDeltaPhiDeltaThetaStarCut();
CbmDeltaPhiDeltaThetaStarCut&
operator=(const CbmDeltaPhiDeltaThetaStarCut& other);
CbmDeltaPhiDeltaThetaStarCut& operator=(const CbmDeltaPhiDeltaThetaStarCut& other);
void SetR(Double_t r) { fR = r; }
virtual Bool_t Init(Int_t task_id = 0);
Bool_t Pass(NicaTwoTrack* pair);
......
......@@ -10,45 +10,31 @@
#include "CbmHbtTrack.h"
#include "CbmHelix.h"
#include "NicaCbmATTrack.h"
#include "NicaExpEvent.h"
#include "NicaTwoTrack.h"
#include <TLorentzVector.h>
#include <TVector3.h>
CbmStsExitSepCut::CbmStsExitSepCut()
: NicaTwoTrackCut(1), fDataType(NicaCbmFormats::ECbmFormatType::kUnknown) {
#include "NicaCbmTrack.h"
#include "NicaExpEvent.h"
#include "NicaTwoTrack.h"
CbmStsExitSepCut::CbmStsExitSepCut() : NicaTwoTrackCut(1), fDataType(NicaCbmFormats::ECbmFormatType::kUnknown)
{
SetUnitName("StsExitSep [cm]");
SetMinMax(0, 1E+5);
}
Bool_t CbmStsExitSepCut::Pass(NicaTwoTrack* pair) {
Bool_t CbmStsExitSepCut::Pass(NicaTwoTrack* pair)
{
CbmHelix *h1 = nullptr, *h2 = nullptr;
TLorentzVector *Pos1 = nullptr, *Pos2 = nullptr;
Double_t dist = 0;
switch (fDataType) {
case NicaCbmFormats::ECbmFormatType::kCbmRoot: {
case NicaCbmFormats::ECbmFormatType::kAnaTree: {
NicaCbmTrack* tr1 = static_cast<NicaCbmTrack*>(pair->GetTrack1());
NicaCbmTrack* tr2 = static_cast<NicaCbmTrack*>(pair->GetTrack2());
Pos1 = static_cast<NicaExpEvent*>(tr1->GetEvent())->GetVertex();
Pos2 = static_cast<NicaExpEvent*>(tr2->GetEvent())->GetVertex();
h1 = tr1->GetHelix();
h2 = tr2->GetHelix();
TVector3 pos1 = h1->Eval(101.1 + Pos1->Z());
TVector3 pos2 = h2->Eval(101.1 + Pos2->Z());
pos1.SetX(pos1.X() - Pos1->X());
pos1.SetY(pos1.Y() - Pos1->Y());
pos2.SetX(pos2.X() - Pos2->X());
pos2.SetY(pos2.Y() - Pos2->Y());
dist = (pos1 - pos2).Mag();
} break;
case NicaCbmFormats::ECbmFormatType::kAnaTree: {
NicaCbmATTrack* tr1 = static_cast<NicaCbmATTrack*>(pair->GetTrack1());
NicaCbmATTrack* tr2 = static_cast<NicaCbmATTrack*>(pair->GetTrack2());
Pos1 = static_cast<NicaExpEvent*>(tr1->GetEvent())->GetVertex();
Pos2 = static_cast<NicaExpEvent*>(tr2->GetEvent())->GetVertex();
Pos1 = static_cast<NicaExpEvent*>(tr1->GetEvent())->GetVertex();
Pos2 = static_cast<NicaExpEvent*>(tr2->GetEvent())->GetVertex();
h1 = tr1->GetHelix();
h2 = tr2->GetHelix();
......@@ -75,9 +61,9 @@ Bool_t CbmStsExitSepCut::Pass(NicaTwoTrack* pair) {
return Validate();
}
Bool_t CbmStsExitSepCut::Init(Int_t task_id) {
fDataType =
NicaCbmFormats::GetFormatType(task_id, ENicaFormatDepth::kBuffered);
Bool_t CbmStsExitSepCut::Init(Int_t task_id)
{
fDataType = NicaCbmFormats::GetFormatType(task_id, ENicaFormatDepth::kBuffered);
if (fDataType == NicaCbmFormats::ECbmFormatType::kUnknown) return kFALSE;
return kTRUE;
}
......
......@@ -10,7 +10,6 @@
#define PAIRCUTS_CBMSTSEXITSEPCUT_H_
#include "NicaCbmFormatTypes.h"
#include "NicaCbmTrack.h"
#include "NicaTwoTrackCut.h"
......
/*
* CbmAvXYCut.cpp
*
* Created on: 15 cze 2020
* Author: Daniel Wielanek
* E-mail: daniel.wielanek@gmail.com
* Warsaw University of Technology, Faculty of Physics
*/
#include "CbmAvXYCut.h"
#include "CbmHelix.h"
#include "NicaExpEvent.h"
#include "NicaTwoTrack.h"
#include <TLorentzVector.h>
#include <TVector3.h>
CbmAvXYCut::CbmAvXYCut() : NicaTwoTrackCut(2) {
SetUnitName("X_{av} [cm]", 0);
SetUnitName("Y_{av} [cm]", 1);
SetMinMax(-90, 90, 0);
SetMinMax(-90, 90, 1);
}
Bool_t CbmAvXYCut::Init(Int_t task_id) {
if (FormatInhertis("NicaCbmEvent", task_id)
|| FormatInhertis("NicaCbmGlobalMCEvent", task_id)) {
return kTRUE;
}
return kFALSE;
}
Bool_t CbmAvXYCut::Pass(NicaTwoTrack* pair) {
NicaCbmTrack* tr1 = static_cast<NicaCbmTrack*>(pair->GetTrack1());
NicaCbmTrack* tr2 = static_cast<NicaCbmTrack*>(pair->GetTrack2());
TLorentzVector* Pos1 =
static_cast<NicaExpEvent*>(tr1->GetEvent())->GetVertex();
TLorentzVector* Pos2 =
static_cast<NicaExpEvent*>(tr2->GetEvent())->GetVertex();
CbmHelix* h1 = tr1->GetHelix();
CbmHelix* h2 = tr2->GetHelix();
TVector3 pos1 = h1->Eval(50.1 + Pos1->Z());
TVector3 pos2 = h2->Eval(50.1 + Pos2->Z());
pos1.SetX(pos1.X() - Pos1->X());
pos1.SetY(pos1.Y() - Pos1->Y());
pos2.SetX(pos2.X() - Pos2->X());
pos2.SetY(pos2.Y() - Pos2->Y());
TVector3 av = pos1 + pos2;
SetValue(av.X() * 0.5, 0);
SetValue(av.Y() * 0.5, 1);
return Validate();
}
CbmAvXYCut::~CbmAvXYCut() {}
/*
* CbmAvXYCut.h
*
* Created on: 15 cze 2020
* Author: Daniel Wielanek
* E-mail: daniel.wielanek@gmail.com
* Warsaw University of Technology, Faculty of Physics
*/
#ifndef CBM_NOV_ANALYSIS_CBMFEMTO_CUTS_PAIRCUTS_CBMAVXYCUT_H_
#define CBM_NOV_ANALYSIS_CBMFEMTO_CUTS_PAIRCUTS_CBMAVXYCUT_H_
#include "NicaCbmTrack.h"
#include "NicaTwoTrackCut.h"
class CbmAvXYCut : public NicaTwoTrackCut {
public:
CbmAvXYCut();
virtual Bool_t Init(Int_t task_id = 0);
Bool_t Pass(NicaTwoTrack* pair);
virtual ~CbmAvXYCut();
ClassDef(CbmAvXYCut, 1)
};
#endif /* CBM_NOV_ANALYSIS_CBMFEMTO_CUTS_PAIRCUTS_CBMAVXYCUT_H_ */
/*
* CbmSailorCowboyCut.cxx
*
* Created on: 9 cze 2020
* Author: Daniel Wielanek
* E-mail: daniel.wielanek@gmail.com
* Warsaw University of Technology, Faculty of Physics
*/
#include "CbmSailorCowboyCut.h"
#include "CbmHelix.h"
#include "CbmStsExitSepCut.h"
#include "NicaExpEvent.h"
#include "NicaTwoTrack.h"
CbmSailorCowboyCut::CbmSailorCowboyCut() : NicaTwoTrackCut(1) {
SetUnitName("Sail Cow [Au]", 0);
SetMinMax(0, 1);
}
CbmSailorCowboyCut::~CbmSailorCowboyCut() {}
Bool_t CbmSailorCowboyCut::Init(Int_t task_id) {
if (FormatInhertis("NicaCbmEvent", task_id)
|| FormatInhertis("NicaCbmGlobalMCEvent", task_id)) {
return kTRUE;
}
return kFALSE;
}
Bool_t CbmSailorCowboyCut::Pass(NicaTwoTrack* pair) {
NicaCbmTrack* tr1 = static_cast<NicaCbmTrack*>(pair->GetTrack1());
NicaCbmTrack* tr2 = static_cast<NicaCbmTrack*>(pair->GetTrack2());
TLorentzVector* Pos1 =
static_cast<NicaExpEvent*>(tr1->GetEvent())->GetVertex();
TLorentzVector* Pos2 =
static_cast<NicaExpEvent*>(tr2->GetEvent())->GetVertex();
CbmHelix* h1 = tr1->GetHelix();
CbmHelix* h2 = tr2->GetHelix();
TVector3 pos1[4], pos2[4];
pos1[0] = h1->Eval(Pos1->Z());
pos2[0] = h2->Eval(Pos2->Z());
pos1[1] = h1->Eval(Pos1->Z() + 25.0);
pos2[1] = h2->Eval(Pos2->Z() + 25.0);
pos1[2] = h1->Eval(Pos1->Z() + 50.0);
pos2[2] = h2->Eval(Pos2->Z() + 50.0);
pos1[3] = h1->Eval(Pos1->Z() + 75.0);
pos2[3] = h2->Eval(Pos2->Z() + 75.0);
Double_t minXY = -1000.0;
for (int i = 0; i < 4; i++) {
Double_t dx = (pos1[i].X() - Pos1->X()) - (pos2[i].X() - Pos2->X());
Double_t dy = (pos1[i].Y() - Pos1->Y()) - (pos2[i].Y() - Pos2->Y());
Double_t dR = dx * dx + dy * dy;
if (dR < minXY) { //distance smaller than previous - cowboy
SetValue(Cowboy());
return Validate();