|
|
Go to the documentation of this file.
44 #include "TGLWidget.h"
46 #include "TEveManager.h"
47 #include "TEveEventManager.h"
48 #include "TEveTrackPropagator.h"
49 #include "TEveBrowser.h"
50 #include "TGeoManager.h"
54 class ModuleCallingContext;
58 class CmsEveMagField :
public TEveMagField {
64 CmsEveMagField() : TEveMagField(), fField(-3.8), fFieldMag(3.8) {}
65 ~CmsEveMagField()
override {}
68 void SetFieldByCurrent(Float_t avg_current) {
69 fField = -3.8 * avg_current / 18160.0;
74 Float_t GetMaxFieldMag()
const override {
return fFieldMag; }
76 TEveVector GetField(Float_t
x, Float_t
y, Float_t
z)
const override {
77 static const Float_t barrelFac = 1.2 / 3.8;
78 static const Float_t endcapFac = 2.0 / 3.8;
87 return TEveVector(0, 0, fField);
90 if ((
R > 461.0
f &&
R < 490.5
f) || (
R > 534.5
f &&
R < 597.5
f) || (
R > 637.0
f &&
R < 700.0
f)) {
91 return TEveVector(0, 0, -fField * barrelFac);
94 if ((absZ > 724.0
f && absZ < 786.0
f) || (absZ > 850.0
f && absZ < 910.0
f) || (absZ > 975.0
f && absZ < 1003.0
f)) {
95 const Float_t fac = (
z >= 0 ? fField : -fField) * endcapFac /
R;
96 return TEveVector(
x * fac,
y * fac, 0);
99 return TEveVector(0, 0, 0);
121 changeManager(), selectionManager(), eiManager(), colorManager(), m_metadataManager.
get())),
122 m_Rint(m_appHelper->app()),
127 m_geomWatcher(this, &
FWFFLooper::remakeGeometry) {
136 const char* releaseBase = std::getenv(
"CMSSW_RELEASE_BASE");
137 const char* workarea = std::getenv(
"CMSSW_BASE");
138 std::string displayConfigRelFilename =
"/src/Fireworks/FWInterface/macros/ffw.fwc";
139 std::string geometryRelFilename =
"/src/Fireworks/FWInterface/data/cmsGeom10.root";
144 if (releaseBase && access((releaseBase + displayConfigFilename).c_str(), R_OK) == 0)
145 displayConfigFilename = releaseBase + displayConfigRelFilename;
146 if (workarea && access((workarea + displayConfigRelFilename).c_str(), R_OK) == 0)
147 displayConfigFilename = workarea + displayConfigRelFilename;
149 if (releaseBase && access((releaseBase + geometryRelFilename).c_str(), R_OK) == 0)
151 if (workarea && access((workarea + geometryRelFilename).c_str(), R_OK) == 0)
200 f = std::bind(&TApplication::Terminate,
m_Rint, 0);
206 gSystem->ProcessEvents();
211 printf(
"FWFFLooper::postEndJob\n");
212 TEveManager::Terminate();
228 if (!
guiManager()->playEventsAction()->isEnabled())
241 if (!reachedEnd ||
loop()) {
305 float current = 18160.0f;
311 printf(
"Got current from conds in edm %f\n", runCond->
BAvgCurrent);
314 printf(
"Could not extract run-conditions get-result=%d, is-valid=%d\n",
res, runCond.
isValid());
316 auto rec = iSetup.
find(edm::eventsetup::EventSetupRecordKey::makeKey<RunInfoRcd>());
322 printf(
"Got current from RunInfoRcd %f\n", sum->
m_avg_current);
328 static_cast<CmsEveMagField*>(
m_MagField)->SetFieldByCurrent(current);
460 TEveGeoManagerHolder _tgeo(const_cast<TGeoManager*>(
geom.product()));
bool check(const edm::EventSetup &iSetup)
T const * product() const
void beginRun(const edm::Run &, const edm::EventSetup &) override
Called after all event modules have processed the begin of a Run.
std::unique_ptr< FWFFNavigator > m_navigator
sigc::signal< void > filterButtonClicked_
void setupConfiguration()
void enableActions(bool enable=true)
FWGUIManager * guiManager()
FWRecoGeom::InfoMap idToName
void enableNavigatorControls()
CSGContinuousAction * playEventsAction()
void checkPosition() override
ForwardState forwardState() const
Returns the present state of processing.
void setup(FWNavigatorBase *navigator, fireworks::Context *context, FWJobMetadataManager *metadataManager)
T getUntrackedParameter(std::string const &, T const &) const
void stopPlaying() override
sigc::signal< void, const TGWindow * > showEventFilterGUI_
bool changeModule(const std::string &iLabel, const ParameterSet &iPSet)
void setConfigFilename(const std::string &f)
CmsShowMainFrame * getMainFrame() const
void updateStatus(const char *status)
void enableComplexNavigation(bool enable=true)
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
edm::ESWatcher< DisplayGeomRecord > m_geomWatcher
std::unique_ptr< fireworks::Context > m_context
ScheduleInfo const * scheduleInfo() const
This returns a non-zero value after the constructor has been called.
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
CmsShowTaskExecutor * startupTasks()
void showPathsGUI(const TGWindow *p)
virtual void stopPlaying()
ReverseState reverseState() const
void startAutoLoadTimer()
void setTransitionToPreviousEvent()
void setupFieldForPropagator(TEveTrackPropagator *prop)
edm::EventID m_nextEventId
TEveMagField * getMagField()
ModuleChanger * moduleChanger()
This only returns a non-zero value during the call to endOfLoop.
const std::string & geometryFilename(void)
edm::EDLooperBase::Status endOfLoop(const edm::EventSetup &, unsigned int) override
void attachTo(edm::ActivityRegistry &) override
Override this method if you need to monitor the state of the processing.
FWPathsPopup * m_pathsGUI
void setTransitionToNextEvent()
void setGeometryFilename(const std::string &filename)
void setFilterButtonText(const char *txt)
void initMap(const FWRecoGeom::InfoMap &map)
std::optional< eventsetup::EventSetupRecordGeneric > find(const eventsetup::EventSetupRecordKey &iKey) const
void startDoingTasks() override
FWMagField * getField() const
ModuleChanges m_scheduledChanges
void remakeGeometry(const DisplayGeomRecord &dgRec)
void autoLoadNewEvent() override
edm::EDLooperBase::Status duringLoop(const edm::Event &, const edm::EventSetup &, edm::ProcessingController &) override
void showEventFilterGUI()
void watchPostModuleEvent(PostModuleEvent::slot_type const &iSlot)
void setContext(fireworks::Context *)
void startingNewLoop(unsigned int) override
std::function< void()> TaskFunctor
static void setGeoManagerRuntime(TGeoManager *)
void addTask(const TaskFunctor &iTask)
void display(const std::string &info="")
void setFFFieldMag(float)
FWFFLooper(const edm::ParameterSet &)
fireworks::Context * context()
bool getByLabel(std::string const &label, Handle< PROD > &result) const
TEveMagField * m_MagField
FWEventItemsManager * eiManager()
void requestChanges(const std::string &, const edm::ParameterSet &)
void setTransitionToEvent(edm::EventID const &iID)
void loadDefaultGeometryFile(void)
std::unique_ptr< FWFFMetadataManager > m_metadataManager
void watchPreModuleEvent(PreModuleEvent::slot_type const &iSlot)