Commit fd6a7898 authored by Francesco Giuseppe Gravili's avatar Francesco Giuseppe Gravili Committed by Adam Edward Barton
Browse files

NSW Trigger Simulation - MicroMegas

parent 54c0f956
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
import glob
import os
#######################################
# some basic settings
#######################################
###################################################
# Some basic settings and input file submission
###################################################
MessageSvc.defaultLimit=100
MessageSvc.useColors = True
MessageSvc.Format = "% F%30W%S%7W%R%T %0W%M"
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags
from AthenaCommon.AthenaCommonFlags import athenaCommonFlags, jobproperties
athenaCommonFlags.AllowIgnoreConfigError=False #This job will stop if an include fails
athenaCommonFlags.EvtMax = -1
athenaCommonFlags.SkipEvents = 0
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
import AthenaPoolCnvSvc.ReadAthenaPool # needed to use EventSelector
svcMgr.EventSelector.InputCollections=["input.rdo.pool.root"]
#######################################
#######################################
# initialize the geometry
#######################################
from AthenaCommon.GlobalFlags import jobproperties
jobproperties.Global.DetDescrVersion="ATLAS-R3S-2021-01-00-00"
#to run on mutliple files at once please use -c "customInput='/some/path/*pattern*.root'"
if 'customInput' not in locals() or 'customInput' not in globals():
print("customInput not defined: the job will be launched on the GRID")
svcMgr.EventSelector.InputCollections=jobproperties.AthenaCommonFlags.FilesInput.get_Value()
else:
if(os.path.isdir(customInput)): customInput+="/*.root"
svcMgr.EventSelector.InputCollections=glob.glob(customInput)
###################################################
# Detector flags: needed to setup geometry tools
###################################################
from AthenaCommon.DetFlags import DetFlags
DetFlags.detdescr.Muon_setOn()
DetFlags.sTGC_setOff()
DetFlags.Micromegas_setOn()
DetFlags.digitize.Micromegas_setOn()
DetFlags.digitize.sTGC_setOff()
DetFlags.Truth_setOn()
DetFlags.Print()
###################################################
# Initialize ATLAS geometry
###################################################
jobproperties.Global.DetDescrVersion="ATLAS-R3S-2021-01-00-02"
from AtlasGeoModel import SetGeometryVersion
from AtlasGeoModel import GeoModelInit
from GeoModelSvc.GeoModelSvcConf import GeoModelSvc
GeoModelSvc = GeoModelSvc()
from AtlasGeoModel import MuonGM
from AtlasGeoModel import Agdd2Geo
from AtlasGeoModel.MuonGMJobProperties import MuonGeometryFlags
# initialize the MuonIdHelperService
from MuonIdHelpers.MuonIdHelpersConf import Muon__MuonIdHelperSvc
svcMgr += Muon__MuonIdHelperSvc("MuonIdHelperSvc",HasCSC=MuonGeometryFlags.hasCSC(), HasSTgc=MuonGeometryFlags.hasSTGC(), HasMM=MuonGeometryFlags.hasMM())
# create the MuonDetectorTool (which creates the MuonDetectorManager needed by PadTdsOfflineTool)
from MuonGeoModel.MuonGeoModelConf import MuonDetectorTool
GeoModelSvc.DetectorTools += [ MuonDetectorTool(HasCSC=MuonGeometryFlags.hasCSC(), HasSTgc=MuonGeometryFlags.hasSTGC(), HasMM=MuonGeometryFlags.hasMM()) ]
#######################################
#######################################
# now the trigger related things
#######################################
###################################################
# Initialize the trigger related things
###################################################
include('TrigT1NSW/TrigT1NSW_jobOptions.py')
#Switch on and off trigger simulaton components sTGC / MicroMegas
#October 2019 : MM not working so keep it False until fixed
topSequence.NSWL1Simulation.DosTGC=True
topSequence.NSWL1Simulation.DosTGC=False
topSequence.NSWL1Simulation.UseLookup=False #use lookup table for the pad trigger
topSequence.NSWL1Simulation.DoMM=False
topSequence.NSWL1Simulation.DoMM=True
topSequence.NSWL1Simulation.DoMMDiamonds=True
topSequence.NSWL1Simulation.NSWTrigRDOContainerName="NSWTRGRDO"
topSequence.NSWL1Simulation.StripSegmentTool.rIndexScheme=0
......@@ -76,12 +87,12 @@ topSequence.NSWL1Simulation.StripSegmentTool.OutputLevel=INFO
#S.I 2019 : Below code handles enabling/disabling of ntuples for the Tools according to the master flag (NSWL1Simulation)
#in principle we wouldnt need the tuning here but ntuple making and the trigger code is quite tangled so this is just a workaround for now
#ntuple code must be totally stripped off from trigger Tools. One way of doing is to create a separate tool and implement methods that takes
# std::vector<std::shared_ptr<PadData>> pads;
#ntuple code must be totally stripped off from trigger Tools. One way of doing is to create a separate tool and implement methods that takes
# std::vector<std::shared_ptr<PadData>> pads;
# std::vector<std::unique_ptr<PadTrigger>> padTriggers;
# std::vector<std::unique_ptr<StripData>> strips;
# std::vector< std::unique_ptr<StripClusterData> > clusters;
# as arguments (see NSWL1Simulation.cxx)
# as arguments (see NSWL1Simulation.cxx)
if topSequence.NSWL1Simulation.DoNtuple:
......@@ -99,7 +110,7 @@ if topSequence.NSWL1Simulation.DoNtuple:
ServiceMgr += NTupleSvc()
ServiceMgr.THistSvc.Output += [ "NSWL1Simulation DATAFILE='NSWL1Simulation.root' OPT='RECREATE'" ]
print ServiceMgr
print(ServiceMgr)
else:#to avoid any possible crash. If DoNtuple is set to true for a tool but false for NSWL1Simulation the code will crash
# ideally that should have been already handled in C++ side
......
......@@ -25,8 +25,8 @@ namespace NSWL1 {
m_pad_trigger("NSWL1::PadTriggerLogicOfflineTool",this),
m_pad_trigger_lookup("NSWL1::PadTriggerLookupTool",this),
m_strip_tds("NSWL1::StripTdsOfflineTool",this),
m_strip_cluster("NSWL1::StripClusterTool",this),
m_strip_segment("NSWL1::StripSegmentTool",this),
//m_strip_cluster("NSWL1::StripClusterTool",this),
//m_strip_segment("NSWL1::StripSegmentTool",this), TODO: this line makes the code crash in initialization... please, sTGC friends, fix it!!!
m_mmstrip_tds("NSWL1::MMStripTdsOfflineTool",this),
m_mmtrigger("NSWL1::MMTriggerTool",this),
m_tree(nullptr),
......@@ -36,24 +36,24 @@ namespace NSWL1 {
// Property setting general behaviour:
declareProperty( "DoOffline", m_doOffline = false, "Steers the offline emulation of the LVL1 logic" );
declareProperty( "UseLookup", m_useLookup = false, "Toggle Lookup mode on and off default is the otf(old) mode" );
declareProperty( "DoNtuple", m_doNtuple = false, "Create an ntuple for data analysis" );
declareProperty( "DoMM", m_doMM = false, "Run data analysis for MM" );
declareProperty( "DosTGC", m_dosTGC = true, "Run data analysis for sTGCs" );
declareProperty( "UseLookup", m_useLookup = false, "Toggle Lookup mode on and off default is the otf(old) mode" );
declareProperty( "DoNtuple", m_doNtuple = true, "Create an ntuple for data analysis" );
declareProperty( "DoMM", m_doMM = true, "Run data analysis for MM" );
declareProperty( "DoMMDiamonds", m_doMMDiamonds = false, "Run data analysis for MM using Diamond Roads algorithm" );
declareProperty( "DosTGC", m_dosTGC = false, "Run data analysis for sTGCs" );
// declare monitoring tools
declareProperty( "AthenaMonTools", m_monitors, "List of monitoring tools to be run with this instance, if incorrect then tool is silently skipped.");
declareProperty( "PadTdsTool", m_pad_tds, "Tool that simulates the functionalities of the PAD TDS");
declareProperty( "AthenaMonTools", m_monitors, "List of monitoring tools to be run with this instance, if incorrect then tool is silently skipped.");
declareProperty( "PadTdsTool", m_pad_tds, "Tool that simulates the functionalities of the PAD TDS");
//PadTriggerTool : in principle can be totally wuiped out. necesary for ntuples currently. Once you isolate ntuple making code and the trigger code you can abandon this method. Things ae still tangled a bit somewhow so keep it just in case
declareProperty( "PadTriggerTool", m_pad_trigger, "Tool that simulates the pad trigger logic");
declareProperty( "PadTriggerLookupTool", m_pad_trigger_lookup, "Tool that is used to lookup pad trigger patterns per execute against the same LUT as in trigger FPGA");
declareProperty( "StripTdsTool", m_strip_tds, "Tool that simulates the functionalities of the Strip TDS");
declareProperty( "StripClusterTool",m_strip_cluster, "Tool that simulates the Strip Clustering");
declareProperty( "StripSegmentTool",m_strip_segment, "Tool that simulates the Segment finding");
declareProperty( "MMStripTdsTool", m_mmstrip_tds, "Tool that simulates the functionalities of the MM STRIP TDS");
declareProperty( "MMTriggerTool", m_mmtrigger, "Tool that simulates the MM Trigger");
declareProperty("NSWTrigRDOContainerName", m_trigRdoContainer = "NSWTRGRDO"," Give a name to NSW trigger rdo container");
declareProperty( "PadTriggerTool", m_pad_trigger, "Tool that simulates the pad trigger logic");
declareProperty( "PadTriggerLookupTool", m_pad_trigger_lookup, "Tool that is used to lookup pad trigger patterns per execute against the same LUT as in trigger FPGA");
declareProperty( "StripTdsTool", m_strip_tds, "Tool that simulates the functionalities of the Strip TDS");
declareProperty( "StripClusterTool", m_strip_cluster, "Tool that simulates the Strip Clustering");
declareProperty( "StripSegmentTool", m_strip_segment, "Tool that simulates the Segment finding");
declareProperty( "MMStripTdsTool", m_mmstrip_tds, "Tool that simulates the functionalities of the MM STRIP TDS");
declareProperty( "MMTriggerTool", m_mmtrigger, "Tool that simulates the MM Trigger");
declareProperty( "NSWTrigRDOContainerName", m_trigRdoContainer = "NSWTRGRDO"," Give a name to NSW trigger rdo container");
}
......@@ -80,7 +80,6 @@ namespace NSWL1 {
}
// retrieving the private tools implementing the simulation
if(m_dosTGC){
ATH_CHECK(m_pad_tds.retrieve());
if(m_useLookup){
......@@ -90,13 +89,15 @@ namespace NSWL1 {
ATH_CHECK(m_pad_trigger.retrieve());
}
ATH_CHECK(m_strip_tds.retrieve());
ATH_CHECK(m_strip_cluster.retrieve());
ATH_CHECK(m_strip_segment.retrieve());
//ATH_CHECK(m_strip_cluster.retrieve());
//ATH_CHECK(m_strip_segment.retrieve());
}
if(m_doMM ){
ATH_CHECK(m_mmtrigger.retrieve());
if(m_doMMDiamonds) ATH_CHECK( m_mmtrigger->initDiamondAlgorithm() );
}
// Connect to Monitoring Service
ATH_CHECK(m_monitors.retrieve());
return StatusCode::SUCCESS;
......@@ -105,7 +106,6 @@ namespace NSWL1 {
StatusCode NSWL1Simulation::start() {
ATH_MSG_INFO("start " << name() );
for ( auto& mon : m_monitors ) {
ATH_CHECK(mon->bookHists());
}
......@@ -137,8 +137,8 @@ namespace NSWL1 {
}
ATH_CHECK( m_strip_tds->gather_strip_data(strips,padTriggers) );
ATH_CHECK( m_strip_cluster->cluster_strip_data(strips,clusters) );
ATH_CHECK( m_strip_segment->find_segments(clusters,trgContainer) );
//ATH_CHECK( m_strip_cluster->cluster_strip_data(strips,clusters) );
//ATH_CHECK( m_strip_segment->find_segments(clusters,trgContainer) );
auto rdohandle = SG::makeHandle( m_trigRdoContainer );
ATH_CHECK( rdohandle.record( std::move(trgContainer)));
......@@ -146,7 +146,7 @@ namespace NSWL1 {
//retrive the MM Strip hit data
if(m_doMM){
ATH_CHECK( m_mmtrigger->runTrigger() );
ATH_CHECK( m_mmtrigger->runTrigger(m_doMMDiamonds) );
}
for ( auto& mon : m_monitors) {
ATH_CHECK(mon->fillHists());
......@@ -162,6 +162,7 @@ namespace NSWL1 {
for ( auto& mon : m_monitors ) {
ATH_CHECK(mon->finalHists());
}
if(m_doMM) ATH_CHECK( m_mmtrigger->finalizeDiamondAlgorithm(m_doMMDiamonds) );
return StatusCode::SUCCESS;
}
......
......@@ -42,7 +42,7 @@ namespace NSWL1 {
* or the detailed hardware simulation.
*
* @authors Alessandro Di Mattia <dimattia@cern.ch>, Geraldine Conti <geraldine.conti@cern.ch>
*
* Major updates for Release 22 processing: Francesco Giuseppe Gravili <francesco.giuseppe.gravili@cern.ch>
*
*/
......@@ -74,7 +74,7 @@ namespace NSWL1 {
ToolHandle < IStripClusterTool > m_strip_cluster; //!< property, see @link NSWL1Simulation::NSWL1Simulation @endlink
ToolHandle < IStripSegmentTool > m_strip_segment; //!< property, see @link NSWL1Simulation::NSWL1Simulation @endlink
ToolHandle < IMMStripTdsTool > m_mmstrip_tds; //!< property, see @link NSWL1Simulation::NSWL1Simulation @endlink
ToolHandle < IMMTriggerTool > m_mmtrigger; //!< property, see @link NSWL1Simulation::NSWL1Simulation @endlink
ToolHandle < IMMTriggerTool > m_mmtrigger; //!< property, see @link NSWL1Simulation::NSWL1Simulation @endlink
// put analysis variables here
TTree* m_tree; //!< analysis ntuple
......@@ -87,6 +87,7 @@ namespace NSWL1 {
bool m_useLookup;
bool m_doNtuple; //!< property, see @link NSWL1Simulation::NSWL1Simulation @endlink
bool m_doMM; //!< property, see @link NSWL1Simulation::NSWL1Simulation @endlink
bool m_doMMDiamonds; //!< property, see @link NSWL1Simulation::NSWL1Simulation @endlink
bool m_dosTGC; //!< property, see @link NSWL1Simulation::NSWL1Simulation @endlink
......
......@@ -13,7 +13,7 @@ atlas_add_library( TrigT1NSWSimToolsLib
src/*.cxx
PUBLIC_HEADERS TrigT1NSWSimTools
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps AthenaKernel GaudiKernel GeoPrimitives Identifier MuonDigitContainer MuonIdHelpersLib MuonRDO MuonReadoutGeometry MuonSimData MuonSimEvent RegSelLUT TrkSurfaces
LINK_LIBRARIES ${Boost_LIBRARIES} ${ROOT_LIBRARIES} AthenaBaseComps AthenaKernel FourMomUtils GaudiKernel GeoPrimitives Identifier MuonDigitContainer MuonIdHelpersLib MuonRDO MuonReadoutGeometry MuonSimData MuonSimEvent RegSelLUT TrkSurfaces
PRIVATE_LINK_LIBRARIES ${CLHEP_LIBRARIES} AGDDKernel AtlasHepMCLib EventInfo GeneratorObjects MuonAGDDDescription MuonRegionSelectorLib PathResolver StoreGateLib TrackRecordLib )
# Component(s) in the package:
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef IMMTRIGGERTOOL_H
......@@ -23,8 +23,9 @@ namespace NSWL1 {
public:
virtual ~IMMTriggerTool() {}
virtual StatusCode runTrigger() = 0;
virtual StatusCode runTrigger(const bool do_MMDiamonds) = 0;
virtual StatusCode initDiamondAlgorithm() = 0;
virtual StatusCode finalizeDiamondAlgorithm(const bool do_MMDiamonds) = 0;
static const InterfaceID& interfaceID() {
static const InterfaceID IID_IMMTriggerTool("NSWL1::IMMTriggerTool", 1 ,0);
......
......@@ -18,7 +18,6 @@ class MmDigit;
class StoreGateSvc;
class MMT_Parameters;
class MmDigitContainer;
class TVector3;
namespace MuonGM {
class MuonDetectorManager;
......@@ -28,18 +27,20 @@ namespace MuonGM {
public:
MMLoadVariables(StoreGateSvc* evtStore, const MuonGM::MuonDetectorManager* detManager, const MmIdHelper* idhelper, MMT_Parameters *par);
MMLoadVariables(StoreGateSvc* evtStore, const MuonGM::MuonDetectorManager* detManager, const MmIdHelper* idhelper, std::map<std::string,MMT_Parameters*> pars);
StatusCode getMMDigitsInfo(std::vector<digitWrapper>& entries, std::map<hitData_key,hitData_entry>& Hits_Data_Set_Time, std::map<int,evInf_entry>& Event_Info);
StatusCode getMMDigitsInfo(std::map<std::pair<int,unsigned int>,std::vector<digitWrapper> >& entries,
std::map<std::pair<int,unsigned int>,std::map<hitData_key,hitData_entry> >& Hits_Data_Set_Time,
std::map<std::pair<int,unsigned int>,evInf_entry>& Event_Info);
//Import_Athena..._.m stuff
double phi_shift(double athena_phi,const std::string& wedgeType, int stationPhi) const;
int Get_VMM_chip(int strip) const; //*** Not Finished... Rough
int strip_number(int station,int plane,int spos)const;
int strip_number(int station, int plane, int spos, const MMT_Parameters *par)const;
int Get_Strip_ID(double X,double Y,int plane) const;
bool Mimic_VMM_Chip_Deadtime(hitData_entry& candy);
void xxuv_to_uvxx(TVector3& hit,int plane)const;
void hit_rot_stereo_fwd(TVector3& hit)const;//x to v, u to x
void hit_rot_stereo_bck(TVector3& hit)const;//x to u, v to x
void xxuv_to_uvxx(ROOT::Math::XYZVector& hit, int plane, const MMT_Parameters *par)const;
void hit_rot_stereo_fwd(ROOT::Math::XYZVector& hit, const MMT_Parameters *par)const;//x to v, u to x
void hit_rot_stereo_bck(ROOT::Math::XYZVector& hit, const MMT_Parameters *par)const;//x to u, v to x
struct histogramVariables{
std::vector<std::string> *m_NSWMM_dig_stationName;
......@@ -142,7 +143,7 @@ namespace MuonGM {
const MuonGM::MuonDetectorManager* m_detManager; //!< MuonDetectorManager
const MmIdHelper* m_MmIdHelper; //!< MM offline Id helper
StoreGateSvc* m_evtStore;
MMT_Parameters* m_par{};
std::map<std::string, MMT_Parameters*> m_pars{};
bool m_striphack{};
std::string getWedgeType(const MmDigitContainer *nsw_MmDigitContainer);
......
......@@ -94,9 +94,9 @@ namespace NSWL1 {
int Get_Strip_ID(double X,double Y,int plane) const;
//x <---> u/v switches
void xxuv_to_uvxx(TVector3& hit,int plane)const;
void hit_rot_stereo_fwd(TVector3& hit)const;//x to v, u to x
void hit_rot_stereo_bck(TVector3& hit)const;//x to u, v to x
void xxuv_to_uvxx(ROOT::Math::XYZVector& hit,int plane)const;
void hit_rot_stereo_fwd(ROOT::Math::XYZVector& hit)const;//x to v, u to x
void hit_rot_stereo_bck(ROOT::Math::XYZVector& hit)const;//x to u, v to x
//MMT_Loader stuff end
......
/*
* Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef MMT_DIAMOND_H
#define MMT_DIAMOND_H
#include "AthenaBaseComps/AthMessaging.h"
#include "MMT_Road.h"
#include <vector>
struct slope_t {
slope_t(int ev=-1, int bc=-1, unsigned int tC=999, unsigned int rC=999, int iX=-1, int iU=-1, int iV=-1, unsigned int uvb=999, unsigned int xb=999,
unsigned int uvm=999, unsigned int xm=999, int age=-1, double mxl=999., double xavg=999., double uavg=999., double vavg=999.,
double th=999., double eta=999., double dth=999., double phi=999., double phiS=999.);
unsigned int event;
int BC;
unsigned int totalCount;
unsigned int realCount;
int iRoad;
int iRoadu;
int iRoadv;
unsigned int uvbkg;
unsigned int xbkg;
unsigned int uvmuon;
unsigned int xmuon;
int age;
double mxl;
double xavg;
double uavg;
double vavg;
double theta;
double eta;
double dtheta;
double phi;
double phiShf;
};
struct diamond_t {
unsigned int wedgeCounter;
char sector;
int phi;
std::vector<MMT_Road*> ev_roads;
std::vector<slope_t> slopes;
std::vector<MMT_Hit*> ev_hits;
};
class MMT_Diamond : public AthMessaging {
public:
MMT_Diamond(const MuonGM::MuonDetectorManager* detManager);
void clearEvent();
void createRoads_fillHits(const unsigned int iterator, std::vector<hitData_entry> &hitDatas, const MuonGM::MuonDetectorManager* detManager, MMT_Parameters *par, const int phi);
void findDiamonds(const unsigned int iterator, const double &sm_bc, const int &event);
double phiShift(const int &n, const double &phi, const char &side);
std::vector<diamond_t> getDiamondVector() const { return m_diamonds; }
diamond_t getDiamond(const unsigned int iterator) const { return m_diamonds.at(iterator); }
std::vector<double> getHitSlopes() const { return m_hitslopes; }
std::vector<MMT_Hit*> getHitVector(const unsigned int iterator) const { return m_diamonds.at(iterator).ev_hits; }
std::vector<slope_t> getSlopeVector(const unsigned int iterator) const { return m_diamonds.at(iterator).slopes; }
unsigned int getDiamondSize() const { return m_diamonds.size(); }
int getUVfactor() const { return m_uvfactor; }
void printHits(const unsigned int iterator);
void resetSlopes();
void setTrapezoidalShape(bool flag) { m_trapflag = flag; }
void setUVfactor(int factor) { m_uvfactor = factor; }
bool isTrapezoidalShape() const { return m_trapflag; }
int getStationPhi() const { return m_phi; }
int getRoadSize() const { return m_roadSize; }
void setRoadSize(int size) { m_roadSize = size; }
int getRoadSizeUpX() const { return m_roadSizeUpX; }
void setRoadSizeUpX(int sizeUp) { m_roadSizeUpX = sizeUp; }
int getRoadSizeDownX() const { return m_roadSizeDownX; }
void setRoadSizeDownX(int sizeDown) { m_roadSizeDownX = sizeDown; }
int getRoadSizeUpUV() const { return m_roadSizeUpUV; }
void setRoadSizeUpUV(int sizeUpUV) { m_roadSizeUpUV = sizeUpUV; }
int getRoadSizeDownUV() const { return m_roadSizeDownUV; }
void setRoadSizeDownUV(int sizeDownUV) { m_roadSizeDownUV = sizeDownUV; }
char getSector() const { return m_sector; }
unsigned int getXthreshold() const { return m_xthr; }
void setXthreshold(int threshold) { m_xthr = threshold; }
bool getUV() const { return m_uvflag; }
void setUV(bool flag) { m_uvflag = flag; }
unsigned int getUVthreshold() const { return m_uvthr; }
void setUVthreshold(int threshold) { m_uvthr = threshold; }
private:
const MuonGM::MuonDetectorManager* m_detManager{}; //!< MuonDetectorManager
bool m_trapflag;
int m_uvfactor;
bool m_uvflag;
int m_roadSize, m_roadSizeUpX, m_roadSizeDownX, m_roadSizeUpUV, m_roadSizeDownUV;
int m_xthr, m_uvthr;
int m_phi;
char m_sector;
std::vector<diamond_t> m_diamonds;
std::vector<double> m_hitslopes;
};
#endif
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef MMT_FINDER_H
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef MMT_FITTER_H
......@@ -27,13 +27,13 @@ class MMT_Fitter : AthMessaging {
//functions translated
int Filter_UV(std::vector<Hit>& track) const;
float32fixed<2> Get_Global_Slope(const std::vector<Hit>& track, const std::string& type) const;
float32fixed<2> Get_Local_Slope(const std::vector<Hit>& Track,double theta=-999.,double phi=-999.) const;
ROI Get_ROI(float32fixed<2> M_x,float32fixed<2> M_u,float32fixed<2> M_v,const std::vector<Hit>&track) const;
double Get_Global_Slope(const std::vector<Hit>& track, const std::string& type) const;
double Get_Local_Slope(const std::vector<Hit>& Track,double theta=-999.,double phi=-999.) const;
ROI Get_ROI(double M_x,double M_u,double M_v,const std::vector<Hit>&track) const;
double phi_correct_factor(const std::vector<Hit>&track)const;
float32fixed<2> Get_Delta_Theta(float32fixed<2> M_local,float32fixed<2> M_global) const;
float32fixed<2> Get_Delta_Theta_division(float32fixed<2> M_local,float32fixed<2> M_global, float32fixed<4> a=1.) const;
int Rough_ROI_temp(float32fixed<4> theta, float32fixed<4> phi) const;
double Get_Delta_Theta(double M_local,double M_global) const;
double Get_Delta_Theta_division(double M_local,double M_global, double a=1.) const;
int Rough_ROI_temp(double theta, double phi) const;
//sim hit code stuff
int track_to_index(const std::vector<Hit>&track)const;
......@@ -45,12 +45,12 @@ class MMT_Fitter : AthMessaging {
double ideal_zbar(const std::vector<Hit>& Track)const;
//translated from Table_Generators.m
float32fixed<2> LG_lgr(int ilgr, double a, int number_LG_regions, float32fixed<2> min, float32fixed<2> max) const;
float32fixed<2> mult_factor_lgr(int ilgr, double a, int number_LG_regions, float32fixed<2> min, float32fixed<2> max) const;
float32fixed<4> Slope_Components_ROI_val(int jy, int ix, int thetaphi) const;
float32fixed<4> Slope_Components_ROI_theta(int jy, int ix) const;
float32fixed<4> Slope_Components_ROI_phi(int jy, int ix) const;
float32fixed<2> DT_Factors_val(int i, int j) const;
double LG_lgr(int ilgr, double a, int number_LG_regions, double min, double max) const;
double mult_factor_lgr(int ilgr, double a, int number_LG_regions, double min, double max) const;
double Slope_Components_ROI_val(int jy, int ix, int thetaphi) const;
double Slope_Components_ROI_theta(int jy, int ix) const;
double Slope_Components_ROI_phi(int jy, int ix) const;
double DT_Factors_val(int i, int j) const;
private:
......@@ -59,7 +59,7 @@ class MMT_Fitter : AthMessaging {
//Fitter components
int m_number_LG_regions,m_n_fit;
float32fixed<2> m_LG_min,m_LG_max;
double m_LG_min,m_LG_max;
std::vector<int> q_planes(char type) const;//return position of what planes are where
};
......
/*
* Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef MMT_HIT_H
#define MMT_HIT_H
#include "AthenaBaseComps/AthMessaging.h"
#include "MMT_struct.h"
namespace MuonGM {
class MuonDetectorManager;
}
class MMT_Hit : public AthMessaging {
public:
MMT_Hit(char wedge, hitData_entry entry, const MuonGM::MuonDetectorManager* detManager);
MMT_Hit(const MMT_Hit &hit);
MMT_Hit& operator=(const MMT_Hit&);
int getART() const { return m_ART_ASIC; }
int getAge() const { return m_age; }
int getBC() const { return m_BC_time; }
int getChannel() const { return m_strip; }
int getGasGap() const { return m_gasgap; }
std::string getModule() const { return m_module; }
int getMultiplet() const { return m_multiplet; }
int getPlane() const { return m_plane; }
char getSector() const { return m_sector; }
double getRZSlope() const { return m_RZslope; }
double getYZSlope() const { return m_YZslope; }
int getVMM() const { return m_VMM_chip; }
int getMMFE8() const { return m_MMFE_VMM; }
std::string getStationName() const { return m_station_name; }
int getStationEta() const { return m_station_eta; }
int getStationPhi() const { return m_station_phi; }
double getR() const { return m_R; }
double getRi() const { return m_Ri; }
double getX() const { return m_localX; }
double getY() const { return m_Y; }
double getZ() const { return m_Z; }
bool isNoise() const { return m_isNoise; }
bool isX() const;
bool isU() const;
bool isV() const;
void printHit();
void setAge(int age) { m_age = age; }
void setAsNoise() { m_isNoise = true; }
void setBC(int bc) { m_BC_time = bc; }
void setHitProperties(const Hit &hit);
void setRZSlope(double slope) { m_RZslope = slope; }
void setYZSlope(double slope) { m_YZslope = slope; }
void setY(double y) { m_Y = y; }
void setZ(double z) { m_Z = z; }
void updateHitProperties(const MMT_Parameters *par);
bool verifyHit();
private:
char m_sector;
std::string m_module, m_station_name;
int m_VMM_chip;
int m_MMFE_VMM;