10#include <analysis/variables/AcceptanceVariables.h> 
   13#include <analysis/VariableManager/Manager.h> 
   15#include <analysis/dataobjects/Particle.h> 
   30    bool thetaInCDCAcceptance(
const Particle* particle)
 
   32      double theta = particle->get4Vector().Theta() * 180. / TMath::Pi();
 
   33      if (theta > 17. && theta < 150.) {
 
   38    bool thetaInTOPAcceptance(
const Particle* particle)
 
   40      double theta = particle->get4Vector().Theta() * 180. / TMath::Pi();
 
   41      if (theta > 32.20 && theta < 123.86) {
 
   46    bool thetaInARICHAcceptance(
const Particle* particle)
 
   48      double theta = particle->get4Vector().Theta() * 180. / TMath::Pi();
 
   49      if (theta > 14. && theta < 30.) {
 
   54    int thetaInECLAcceptance(
const Particle* particle)
 
   56      double theta = particle->get4Vector().Theta() * 180. / TMath::Pi();
 
   57      if (theta > 12.4 && theta < 31.4) { 
 
   59      } 
else if (theta > 32.2 && theta < 128.7) { 
 
   61      } 
else if (theta > 130.7 && theta < 155.1) { 
 
   66    bool thetaInBECLAcceptance(
const Particle* particle)
 
   68      double acceptance = thetaInECLAcceptance(particle);
 
   69      if (acceptance == 2) {
 
   74    bool thetaInEECLAcceptance(
const Particle* particle)
 
   76      double acceptance = thetaInECLAcceptance(particle);
 
   77      if (acceptance == 1 || acceptance == 3) {
 
   82    int thetaInKLMAcceptance(
const Particle* particle)
 
   84      double theta = particle->get4Vector().Theta() * 180. / TMath::Pi();
 
   85      if (theta < 18.)  
return 0;
 
   86      if (theta < 37.)  
return 1; 
 
   87      if (theta < 47.)  
return 2; 
 
   88      if (theta < 122.) 
return 3; 
 
   89      if (theta < 130.) 
return 4; 
 
   90      if (theta < 155.) 
return 5; 
 
   94    bool thetaInBKLMAcceptance(
const Particle* particle)
 
   96      double acceptance = thetaInKLMAcceptance(particle);
 
   97      if (acceptance == 2 || acceptance == 3 || acceptance == 4) {
 
  102    bool thetaInEKLMAcceptance(
const Particle* particle)
 
  104      double acceptance = thetaInKLMAcceptance(particle);
 
  105      if (acceptance != 0 && acceptance != 3) {
 
  110    bool thetaInKLMOverlapAcceptance(
const Particle* particle)
 
  112      double acceptance = thetaInKLMAcceptance(particle);
 
  113      if (acceptance == 2 || acceptance == 4) {
 
  120    bool ptInTOPAcceptance(
const Particle* particle)
 
  122      if (particle->getCharge() == 0) 
return 1;
 
  123      double pt = particle->get4Vector().Pt();
 
  124      if (pt > 0.27)  
return true;
 
  128    bool ptInBECLAcceptance(
const Particle* particle)
 
  130      if (particle->getCharge() == 0) 
return 1;
 
  131      double pt = particle->get4Vector().Pt();
 
  132      if (pt > 0.28)  
return true;
 
  136    bool ptInBKLMAcceptance(
const Particle* particle)
 
  138      if (particle->getCharge() == 0) 
return 1;
 
  139      double pt = particle->get4Vector().Pt();
 
  140      if (pt > 0.6)  
return true;
 
  146    bool inCDCAcceptance(
const Particle* particle)
 
  148      return thetaInCDCAcceptance(particle);
 
  151    bool inTOPAcceptance(
const Particle* particle)
 
  153      return (thetaInTOPAcceptance(particle) && ptInTOPAcceptance(particle));
 
  156    bool inARICHAcceptance(
const Particle* particle)
 
  158      return thetaInARICHAcceptance(particle);
 
  161    bool inECLAcceptance(
const Particle* particle)
 
  163      return (thetaInEECLAcceptance(particle) || (thetaInBECLAcceptance(particle) && ptInBECLAcceptance(particle)));
 
  166    bool inKLMAcceptance(
const Particle* particle)
 
  168      return (thetaInEKLMAcceptance(particle) || (thetaInBKLMAcceptance(particle) && ptInBKLMAcceptance(particle)));
 
  173    VARIABLE_GROUP(
"Acceptance");
 
  175    REGISTER_VARIABLE(
"thetaInCDCAcceptance",   thetaInCDCAcceptance, R
"DOC( 
  176Returns true if particle is within CDC angular acceptance, false otherwise. 
  177This variable checks if the particle polar angle :math:`\theta` is within the range :math:`17^\circ < \theta < 150^\circ`. 
  178The polar angle is computed using only the initial particle momentum. 
  180    REGISTER_VARIABLE("thetaInTOPAcceptance",   thetaInTOPAcceptance, R
"DOC( 
  181Returns true if particle is within TOP angular acceptance, false otherwise. 
  182This variable checks if the particle polar angle :math:`\theta` is within the range :math:`31^\circ < \theta < 128^\circ`. 
  183The polar angle is computed using only the initial particle momentum. 
  185    REGISTER_VARIABLE("thetaInARICHAcceptance", thetaInARICHAcceptance, R
"DOC( 
  186Returns true if particle is within ARICH angular acceptance, false otherwise. 
  187This variable checks if the particle polar angle :math:`\theta` is within the range :math:`14^\circ < \theta < 30^\circ`. 
  188The polar angle is computed using only the initial particle momentum. 
  190    REGISTER_VARIABLE("thetaInECLAcceptance",   thetaInECLAcceptance, R
"DOC( 
  191Checks if particle is within ECL angular acceptance.  
  192This variable checks if the particle polar angle :math:`\theta` is within certain ranges. 
  193Return values and the corresponding :math:`\theta` ranges are the following: 
  195* 0: Outside of ECL acceptance, :math:`\theta < 12.4^\circ` or :math:`\theta > 155.1^\circ`, 
  196  or in one of the acceptance gaps at :math:`31.4^{\circ} < \theta < 32.2^{\circ}` 
  197  or :math:`128.7^{\circ} < \theta < 130.7^{\circ}`; 
  198* 1: Forward ECL,  :math:`12.4^\circ < \theta < 31.4^\circ`;  
  199* 2: Barrel ECL,   :math:`32.2^\circ < \theta < 128.7^\circ`;  
  200* 3: Backward ECL, :math:`130.7^\circ < \theta < 155.1^\circ`. 
  202The polar angle is computed using only the initial particle momentum. 
  204    REGISTER_VARIABLE("thetaInBECLAcceptance",  thetaInBECLAcceptance, R
"DOC( 
  205Returns true if particle is within Barrel ECL angular acceptance, false otherwise. 
  206This variable checks if the particle polar angle :math:`\theta` is within the range :math:`32.2^\circ < \theta < 128.7^\circ`. 
  207The polar angle is computed using only the initial particle momentum. 
  209    REGISTER_VARIABLE("thetaInEECLAcceptance",  thetaInEECLAcceptance, R
"DOC( 
  210Returns true if particle is within Endcap ECL angular acceptance, false otherwise. 
  211This variable checks if the particle polar angle :math:`\theta` is within the range :math:`12.4^\circ < \theta < 31.4^\circ`  
  212or :math:`130.7^\circ < \theta < 155.1^\circ`. 
  213The polar angle is computed using only the initial particle momentum. 
  215    REGISTER_VARIABLE("thetaInKLMAcceptance",   thetaInKLMAcceptance,  R
"DOC( 
  216Checks if particle is within KLM angular acceptance.  
  217This variable checks if the particle polar angle :math:`\theta` is within certain ranges. 
  218Return values and the corresponding :math:`\theta` ranges are the following: 
  220* 0: Outside of KLM acceptance, :math:`\theta < 18^\circ` or :math:`\theta < 155^\circ`. 
  221* 1: Forward endcap,   :math:`18^\circ < \theta < 37^\circ`;  
  222* 2: Forward overlap,  :math:`37^\circ < \theta < 47^\circ`;  
  223* 3: Barrel,           :math:`47^\circ < \theta < 122^\circ`;  
  224* 4: Backward overlap, :math:`122^\circ < \theta < 130^\circ`;  
  225* 5: Backward endcap,  :math:`130^\circ < \theta < 155^\circ`. 
  227The polar angle is computed using only the initial particle momentum. 
  230    REGISTER_VARIABLE("thetaInBKLMAcceptance",  thetaInBKLMAcceptance, R
"DOC( 
  231Returns true if particle is within Barrel KLM angular acceptance, false otherwise. 
  232This variable checks if the particle polar angle :math:`\theta` is within the range :math:`37^\circ < \theta < 130^\circ`. 
  233The polar angle is computed using only the initial particle momentum. 
  235    REGISTER_VARIABLE("thetaInEKLMAcceptance",  thetaInEKLMAcceptance, R
"DOC( 
  236Returns true if particle is within Endcap KLM angular acceptance, false otherwise. 
  237This variable checks if the particle polar angle :math:`\theta` is within the range :math:`18^\circ < \theta < 47^\circ` or :math:`122^\circ < \theta < 155^\circ`. 
  238The polar angle is computed using only the initial particle momentum. 
  240    REGISTER_VARIABLE("thetaInKLMOverlapAcceptance",  thetaInKLMOverlapAcceptance, R
"DOC( 
  241Returns true if particle is within the angular region where KLM barrel and endcaps overlap, false otherwise. 
  242This variable checks if the particle polar angle :math:`\theta` is within the range :math:`37^\circ < \theta < 47^\circ` or :math:`122^\circ < \theta < 130^\circ`. 
  243The polar angle is computed using only the initial particle momentum. 
  246    REGISTER_VARIABLE("ptInTOPAcceptance",   ptInTOPAcceptance,  
"Returns true if particle transverse momentum :math:`p_t` is within TOP acceptance, :math:`p_t > 0.27` GeV, false otherwise.");
 
  247    REGISTER_VARIABLE(
"ptInBECLAcceptance",  ptInBECLAcceptance, 
"Returns true if particle transverse momentum :math:`p_t` is within Barrel ECL acceptance, :math:`p_t > 0.28` GeV, false otherwise.");
 
  248    REGISTER_VARIABLE(
"ptInBKLMAcceptance",  ptInBKLMAcceptance, 
"Returns true if particle transverse momentum :math:`p_t` is within Barrel KLM acceptance, :math:`p_t > 0.6` GeV, false otherwise.");
 
  250    REGISTER_VARIABLE(
"inCDCAcceptance",   inCDCAcceptance, R
"DOC( 
  251Returns true if particle is within CDC geometrical and kinematical acceptance, false otherwise.  
  252This variable is an alias for :b2:var:`thetaInCDCAcceptance`. 
  254    REGISTER_VARIABLE("inTOPAcceptance",   inTOPAcceptance, R
"DOC( 
  255Returns true if particle is within TOP geometrical and kinematical acceptance, false otherwise.  
  256This variable is a combination of :b2:var:`thetaInTOPAcceptance` and :b2:var:`ptInTOPAcceptance`. 
  258    REGISTER_VARIABLE("inARICHAcceptance", inARICHAcceptance, R
"DOC( 
  259Returns true if particle is within ARICH geometrical and kinematical acceptance, false otherwise. 
  260This variable is an alias for :b2:var:`thetaInARICHAcceptance`. 
  262    REGISTER_VARIABLE("inECLAcceptance",   inECLAcceptance, R
"DOC( 
  263Returns true if particle is within ECL geometrical and kinematical acceptance, false otherwise."); 
  264This variable is a combination of :b2:var:`thetaInEECLAcceptance`, :b2:var:`thetaInBECLAcceptance` and :b2:var:`ptInBECLAcceptance`. 
  266    REGISTER_VARIABLE("inKLMAcceptance",   inKLMAcceptance, R
"DOC( 
  267Returns true if particle is within KLM geometrical and kinematical acceptance, false otherwise. 
  268This variable is a combination of :b2:var:`thetaInEKLMAcceptance`, :b2:var:`thetaInBKLMAcceptance` and :b2:var:`ptInBKLMAcceptance`. 
Abstract base class for different kinds of events.