2 #include "boost/bind.hpp"
43 #include "TGLWidget.h"
45 #include "TEveManager.h"
46 #include "TEveEventManager.h"
47 #include "TEveTrackPropagator.h"
48 #include "TEveBrowser.h"
49 #include "TGeoManager.h"
55 class ModuleCallingContext;
60 class CmsEveMagField :
public TEveMagField
68 CmsEveMagField() : TEveMagField(), fField(-3.8), fFieldMag(3.8) {}
69 virtual ~CmsEveMagField() {}
72 void SetFieldByCurrent(Float_t avg_current)
74 fField = -3.8 * avg_current / 18160.0;
79 virtual Float_t GetMaxFieldMag()
const override
84 virtual TEveVector GetField(Float_t
x, Float_t
y, Float_t
z)
const override
86 static const Float_t barrelFac = 1.2 / 3.8;
87 static const Float_t endcapFac = 2.0 / 3.8;
89 const Float_t
R =
sqrt(x*x+y*y);
96 if (R < 300.0
f)
return TEveVector(0, 0, fField);
99 if ((R > 461.0
f && R < 490.5
f) ||
100 (R > 534.5
f && R < 597.5
f) ||
101 (R > 637.0
f && R < 700.0
f))
103 return TEveVector(0, 0, -fField*barrelFac);
106 if ((absZ > 724.0
f && absZ < 786.0
f) ||
107 (absZ > 850.0
f && absZ < 910.0
f) ||
108 (absZ > 975.0
f && absZ < 1003.0
f))
110 const Float_t fac = (z >= 0 ? fField : -fField) * endcapFac / R;
111 return TEveVector(x*fac, y*fac, 0);
114 return TEveVector(0, 0, 0);
135 m_context(new fireworks::
Context(changeManager(),
139 m_metadataManager.
get())),
140 m_Rint(m_appHelper->app()),
145 m_geomWatcher(this, &
FWFFLooper::remakeGeometry)
155 const char *releaseBase = getenv(
"CMSSW_RELEASE_BASE");
156 const char *workarea = getenv(
"CMSSW_BASE");
157 std::string displayConfigRelFilename =
"/src/Fireworks/FWInterface/macros/ffw.fwc";
158 std::string geometryRelFilename =
"/src/Fireworks/FWInterface/data/cmsGeom10.root";
163 if (releaseBase && access((releaseBase + displayConfigFilename).c_str(), R_OK) == 0)
164 displayConfigFilename = releaseBase + displayConfigRelFilename;
165 if (workarea && access((workarea + displayConfigRelFilename).c_str(), R_OK) == 0)
166 displayConfigFilename = workarea + displayConfigRelFilename;
168 if (releaseBase && access((releaseBase + geometryRelFilename).c_str(), R_OK) == 0)
169 geometryFilename = releaseBase + geometryRelFilename;
170 if (workarea && access((workarea + geometryRelFilename).c_str(), R_OK) == 0)
171 geometryFilename = workarea + geometryRelFilename;
179 if( !geometryFilename.empty())
229 f=boost::bind(&TApplication::Terminate,
m_Rint, 0);
235 gSystem->ProcessEvents();
242 printf(
"FWFFLooper::postEndJob\n");
243 TEveManager::Terminate();
262 if (!
guiManager()->playEventsAction()->isEnabled())
277 if (!reachedEnd ||
loop())
358 bool res = iRun.
getByLabel(
"conditionsInEdm", runCond);
361 printf(
"Got current from conds in edm %f\n", runCond->BAvgCurrent);
362 current = runCond->BAvgCurrent;
366 printf(
"Could not extract run-conditions get-result=%d, is-valid=%d\n", res, runCond.
isValid());
374 current = sum->m_avg_current;
375 printf(
"Got current from RunInfoRcd %f\n", sum->m_avg_current);
382 static_cast<CmsEveMagField*
>(
m_MagField)->SetFieldByCurrent(current);
552 TEveGeoManagerHolder _tgeo(const_cast<TGeoManager*>(geom.
product()));
edm::ESWatcher< DisplayGeomRecord > m_geomWatcher
virtual char const * what() const
void startAutoLoadTimer()
TEveMagField * getMagField()
virtual edm::EDLooperBase::Status endOfLoop(const edm::EventSetup &, unsigned int) override
bool getByLabel(std::string const &label, Handle< PROD > &result) const
T getUntrackedParameter(std::string const &, T const &) const
sigc::signal< void > filterButtonClicked_
void setupFieldForPropagator(TEveTrackPropagator *prop)
FWGUIManager * guiManager()
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
void initMap(const FWRecoGeom::InfoMap &map)
virtual void stopPlaying()
void watchPreModuleEvent(PreModuleEvent::slot_type const &iSlot)
FWEventItemsManager * eiManager()
ModuleChanges m_scheduledChanges
virtual void startingNewLoop(unsigned int) override
FWPathsPopup * m_pathsGUI
void watchPostModuleEvent(PostModuleEvent::slot_type const &iSlot)
TEveMagField * m_MagField
void setup(FWNavigatorBase *navigator, fireworks::Context *context, FWJobMetadataManager *metadataManager)
void remakeGeometry(const DisplayGeomRecord &dgRec)
void updateStatus(const char *status)
void setContext(fireworks::Context *)
FWFFLooper(const edm::ParameterSet &)
void enableNavigatorControls()
void loadDefaultGeometryFile(void)
void enableActions(bool enable=true)
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
void requestChanges(const std::string &, const edm::ParameterSet &)
virtual edm::EDLooperBase::Status duringLoop(const edm::Event &, const edm::EventSetup &, edm::ProcessingController &) override
void display(const std::string &info="")
void setGeometryFilename(const std::string &filename)
void setTransitionToEvent(edm::EventID const &iID)
bool changeModule(const std::string &iLabel, const ParameterSet &iPSet) const
CmsShowTaskExecutor * startupTasks()
void setTransitionToPreviousEvent()
ForwardState forwardState() const
Returns the present state of processing.
virtual void beginRun(const edm::Run &, const edm::EventSetup &) override
Called after all event modules have processed the begin of a Run.
ModuleChanger const * moduleChanger() const
This only returns a non-zero value during the call to endOfLoop.
sigc::signal< void, const TGWindow * > showEventFilterGUI_
std::auto_ptr< FWFFNavigator > m_navigator
void get(HolderT &iHolder) const
std::auto_ptr< FWFFMetadataManager > m_metadataManager
void setupConfiguration()
CmsShowMainFrame * getMainFrame() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
ScheduleInfo const * scheduleInfo() const
This returns a non-zero value after the constructor has been called.
void setIsPlaying(bool value)
virtual void checkPosition()
virtual void attachTo(edm::ActivityRegistry &)
Override this method if you need to monitor the state of the processing.
T const * product() const
void setFilterButtonText(const char *txt)
bool check(const edm::EventSetup &iSetup)
CSGContinuousAction * playEventsAction()
boost::function0< void > TaskFunctor
void showEventFilterGUI()
void addTask(const TaskFunctor &iTask)
static void setGeoManagerRuntime(TGeoManager *)
void showPathsGUI(const TGWindow *p)
void setTransitionToNextEvent()
const std::string & geometryFilename(void)
void enableComplexNavigation(bool enable=true)
virtual void autoLoadNewEvent()
edm::EventID m_nextEventId
void setConfigFilename(const std::string &f)
T get(const Candidate &c)
std::auto_ptr< fireworks::Context > m_context
ReverseState reverseState() const