2 #include "boost/bind.hpp"
44 #include "TGLWidget.h"
46 #include "TEveManager.h"
47 #include "TEveEventManager.h"
48 #include "TEveTrackPropagator.h"
49 #include "TEveBrowser.h"
50 #include "TGeoManager.h"
56 class ModuleCallingContext;
61 class CmsEveMagField :
public TEveMagField
69 CmsEveMagField() : TEveMagField(), fField(-3.8), fFieldMag(3.8) {}
70 virtual ~CmsEveMagField() {}
73 void SetFieldByCurrent(Float_t avg_current)
75 fField = -3.8 * avg_current / 18160.0;
80 virtual Float_t GetMaxFieldMag()
const override
85 virtual TEveVector GetField(Float_t
x, Float_t
y, Float_t
z)
const override
87 static const Float_t barrelFac = 1.2 / 3.8;
88 static const Float_t endcapFac = 2.0 / 3.8;
90 const Float_t
R =
sqrt(x*x+y*y);
97 if (R < 300.0
f)
return TEveVector(0, 0, fField);
100 if ((R > 461.0
f && R < 490.5
f) ||
101 (R > 534.5
f && R < 597.5
f) ||
102 (R > 637.0
f && R < 700.0
f))
104 return TEveVector(0, 0, -fField*barrelFac);
107 if ((absZ > 724.0
f && absZ < 786.0
f) ||
108 (absZ > 850.0
f && absZ < 910.0
f) ||
109 (absZ > 975.0
f && absZ < 1003.0
f))
111 const Float_t fac = (z >= 0 ? fField : -fField) * endcapFac / R;
112 return TEveVector(x*fac, y*fac, 0);
115 return TEveVector(0, 0, 0);
136 m_context(new fireworks::
Context(changeManager(),
140 m_metadataManager.
get())),
141 m_Rint(m_appHelper->app()),
146 m_geomWatcher(this, &
FWFFLooper::remakeGeometry)
156 const char *releaseBase = getenv(
"CMSSW_RELEASE_BASE");
157 const char *workarea = getenv(
"CMSSW_BASE");
158 std::string displayConfigRelFilename =
"/src/Fireworks/FWInterface/macros/ffw.fwc";
159 std::string geometryRelFilename =
"/src/Fireworks/FWInterface/data/cmsGeom10.root";
164 if (releaseBase && access((releaseBase + displayConfigFilename).c_str(), R_OK) == 0)
165 displayConfigFilename = releaseBase + displayConfigRelFilename;
166 if (workarea && access((workarea + displayConfigRelFilename).c_str(), R_OK) == 0)
167 displayConfigFilename = workarea + displayConfigRelFilename;
169 if (releaseBase && access((releaseBase + geometryRelFilename).c_str(), R_OK) == 0)
170 geometryFilename = releaseBase + geometryRelFilename;
171 if (workarea && access((workarea + geometryRelFilename).c_str(), R_OK) == 0)
172 geometryFilename = workarea + geometryRelFilename;
176 if( !geometryFilename.empty())
183 if( !geometryFilename.empty())
233 f=boost::bind(&TApplication::Terminate,
m_Rint, 0);
239 gSystem->ProcessEvents();
246 printf(
"FWFFLooper::postEndJob\n");
247 TEveManager::Terminate();
266 if (!
guiManager()->playEventsAction()->isEnabled())
281 if (!reachedEnd ||
loop())
362 bool res = iRun.
getByLabel(
"conditionsInEdm", runCond);
365 printf(
"Got current from conds in edm %f\n", runCond->BAvgCurrent);
366 current = runCond->BAvgCurrent;
370 printf(
"Could not extract run-conditions get-result=%d, is-valid=%d\n", res, runCond.
isValid());
378 current = sum->m_avg_current;
379 printf(
"Got current from RunInfoRcd %f\n", sum->m_avg_current);
386 static_cast<CmsEveMagField*
>(
m_MagField)->SetFieldByCurrent(current);
557 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)
void setFFFieldMag(float)
bool changeModule(const std::string &iLabel, const ParameterSet &iPSet) const
virtual void stopPlaying()
FWMagField * getField() 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
fireworks::Context * context()
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.
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