41 #include "TGLWidget.h"
43 #include "TEveManager.h"
44 #include "TEveEventManager.h"
45 #include "TEveTrackPropagator.h"
46 #include "TEveBrowser.h"
47 #include "TGeoManager.h"
53 class ModuleCallingContext;
58 class CmsEveMagField :
public TEveMagField
66 CmsEveMagField() : TEveMagField(), fField(-3.8), fFieldMag(3.8) {}
67 virtual ~CmsEveMagField() {}
70 void SetFieldByCurrent(Float_t avg_current)
72 fField = -3.8 * avg_current / 18160.0;
77 virtual Float_t GetMaxFieldMag()
const override
82 virtual TEveVector GetField(Float_t
x, Float_t
y, Float_t
z)
const override
84 static const Float_t barrelFac = 1.2 / 3.8;
85 static const Float_t endcapFac = 2.0 / 3.8;
87 const Float_t
R =
sqrt(x*x+y*y);
94 if (R < 300.0
f)
return TEveVector(0, 0, fField);
97 if ((R > 461.0
f && R < 490.5
f) ||
98 (R > 534.5
f && R < 597.5
f) ||
99 (R > 637.0
f && R < 700.0
f))
101 return TEveVector(0, 0, -fField*barrelFac);
104 if ((absZ > 724.0
f && absZ < 786.0
f) ||
105 (absZ > 850.0
f && absZ < 910.0
f) ||
106 (absZ > 975.0
f && absZ < 1003.0
f))
108 const Float_t fac = (z >= 0 ? fField : -fField) * endcapFac / R;
109 return TEveVector(x*fac, y*fac, 0);
112 return TEveVector(0, 0, 0);
133 m_context(new fireworks::
Context(changeManager(),
137 m_metadataManager.
get())),
138 m_Rint(m_appHelper->app()),
143 m_geomWatcher(this, &
FWFFLooper::remakeGeometry)
153 const char *releaseBase = getenv(
"CMSSW_RELEASE_BASE");
154 const char *workarea = getenv(
"CMSSW_BASE");
155 std::string displayConfigRelFilename =
"/src/Fireworks/FWInterface/macros/ffw.fwc";
156 std::string geometryRelFilename =
"/src/Fireworks/FWInterface/data/cmsGeom10.root";
161 if (releaseBase && access((releaseBase + displayConfigFilename).c_str(), R_OK) == 0)
162 displayConfigFilename = releaseBase + displayConfigRelFilename;
163 if (workarea && access((workarea + displayConfigRelFilename).c_str(), R_OK) == 0)
164 displayConfigFilename = workarea + displayConfigRelFilename;
166 if (releaseBase && access((releaseBase + geometryRelFilename).c_str(), R_OK) == 0)
167 geometryFilename = releaseBase + geometryRelFilename;
168 if (workarea && access((workarea + geometryRelFilename).c_str(), R_OK) == 0)
169 geometryFilename = workarea + geometryRelFilename;
177 if( !geometryFilename.empty())
227 f=boost::bind(&TApplication::Terminate,
m_Rint, 0);
233 gSystem->ProcessEvents();
240 printf(
"FWFFLooper::postEndJob\n");
241 TEveManager::Terminate();
260 if (!
guiManager()->playEventsAction()->isEnabled())
275 if (!reachedEnd ||
loop())
356 bool res = iRun.
getByLabel(
"conditionsInEdm", runCond);
359 printf(
"Got current from conds in edm %f\n", runCond->BAvgCurrent);
360 current = runCond->BAvgCurrent;
364 printf(
"Could not extract run-conditions get-result=%d, is-valid=%d\n", res, runCond.
isValid());
372 current = sum->m_avg_current;
373 printf(
"Got current from RunInfoRcd %f\n", sum->m_avg_current);
380 static_cast<CmsEveMagField*
>(
m_MagField)->SetFieldByCurrent(current);
550 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