41 #include "TGLWidget.h"
43 #include "TEveManager.h"
44 #include "TEveEventManager.h"
45 #include "TEveTrackPropagator.h"
46 #include "TEveBrowser.h"
47 #include "TGeoManager.h"
52 class CmsEveMagField :
public TEveMagField
60 CmsEveMagField() : TEveMagField(), fField(-3.8), fFieldMag(3.8) {}
61 virtual ~CmsEveMagField() {}
64 void SetFieldByCurrent(Float_t avg_current)
66 fField = -3.8 * avg_current / 18160.0;
67 fFieldMag = TMath::Abs(fField);
71 virtual Float_t GetMaxFieldMag()
const
76 virtual TEveVector GetField(Float_t
x, Float_t
y, Float_t
z)
const
78 static const Float_t barrelFac = 1.2 / 3.8;
79 static const Float_t endcapFac = 2.0 / 3.8;
81 const Float_t
R =
sqrt(x*x+y*y);
82 const Float_t absZ = TMath::Abs(z);
88 if (R < 300.0
f)
return TEveVector(0, 0, fField);
91 if ((R > 461.0
f && R < 490.5
f) ||
92 (R > 534.5
f && R < 597.5
f) ||
93 (R > 637.0
f && R < 700.0
f))
95 return TEveVector(0, 0, -fField*barrelFac);
98 if ((absZ > 724.0
f && absZ < 786.0
f) ||
99 (absZ > 850.0
f && absZ < 910.0
f) ||
100 (absZ > 975.0
f && absZ < 1003.0
f))
102 const Float_t fac = (z >= 0 ? fField : -fField) * endcapFac / R;
103 return TEveVector(x*fac, y*fac, 0);
106 return TEveVector(0, 0, 0);
127 m_context(new fireworks::
Context(changeManager(),
131 m_metadataManager.
get())),
132 m_Rint(m_appHelper->app()),
137 m_geomWatcher(this, &
FWFFLooper::remakeGeometry)
147 const char *releaseBase = getenv(
"CMSSW_RELEASE_BASE");
148 const char *workarea = getenv(
"CMSSW_BASE");
149 std::string displayConfigRelFilename =
"/src/Fireworks/FWInterface/macros/ffw.fwc";
150 std::string geometryRelFilename =
"/src/Fireworks/FWInterface/data/cmsGeom10.root";
152 std::string displayConfigFilename =
"ffw.fwc";
155 if (releaseBase && access((releaseBase + displayConfigFilename).c_str(), R_OK) == 0)
156 displayConfigFilename = releaseBase + displayConfigRelFilename;
157 if (workarea && access((workarea + displayConfigRelFilename).c_str(), R_OK) == 0)
158 displayConfigFilename = workarea + displayConfigRelFilename;
160 if (releaseBase && access((releaseBase + geometryRelFilename).c_str(), R_OK) == 0)
161 geometryFilename = releaseBase + geometryRelFilename;
162 if (workarea && access((workarea + geometryRelFilename).c_str(), R_OK) == 0)
163 geometryFilename = workarea + geometryRelFilename;
165 displayConfigFilename = ps.
getUntrackedParameter<std::string>(
"displayConfigFilename", displayConfigFilename);
171 if( !geometryFilename.empty())
222 f=boost::bind(&TApplication::Terminate,
m_Rint, 0);
228 gSystem->ProcessEvents();
255 if (!
guiManager()->playEventsAction()->isEnabled())
270 if (!reachedEnd ||
loop())
351 bool res = iRun.
getByLabel(
"conditionsInEdm", runCond);
354 printf(
"Got current from conds in edm %f\n", runCond->BAvgCurrent);
355 current = runCond->BAvgCurrent;
359 printf(
"Could not extract run-conditions get-result=%d, is-valid=%d\n", res, runCond.
isValid());
367 current = sum->m_avg_current;
368 printf(
"Got current from RunInfoRcd %f\n", sum->m_avg_current);
375 static_cast<CmsEveMagField*
>(
m_MagField)->SetFieldByCurrent(current);
545 EDLooperBase::doBeginLuminosityBlock(iLB, iES);
554 EDLooperBase::doEndLuminosityBlock(iLB, iES);
566 TEveGeoManagerHolder _tgeo(const_cast<TGeoManager*>(geom.
product()));
edm::ESWatcher< DisplayGeomRecord > m_geomWatcher
virtual char const * what() const
void startAutoLoadTimer()
TEveMagField * getMagField()
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()
FWEventItemsManager * eiManager()
ModuleChanges m_scheduledChanges
void watchPostModule(PostModule::slot_type const &iSlot)
FWPathsPopup * m_pathsGUI
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)
virtual edm::EDLooperBase::Status duringLoop(const edm::Event &, const edm::EventSetup &, edm::ProcessingController &)
void watchPreModule(PreModule::slot_type const &iSlot)
void enableActions(bool enable=true)
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
void requestChanges(const std::string &, const edm::ParameterSet &)
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
void watchPostProcessEvent(PostProcessEvent::slot_type const &iSlot)
CmsShowTaskExecutor * startupTasks()
void setTransitionToPreviousEvent()
ForwardState forwardState() const
Returns the present state of processing.
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 startingNewLoop(unsigned int)
virtual void checkPosition()
virtual void attachTo(edm::ActivityRegistry &)
Override this method if you need to monitor the state of the processing.
virtual void doBeginLuminosityBlock(edm::LuminosityBlockPrincipal &, edm::EventSetup const &)
T const * product() const
void setFilterButtonText(const char *txt)
bool check(const edm::EventSetup &iSetup)
CSGContinuousAction * playEventsAction()
virtual edm::EDLooperBase::Status endOfLoop(const edm::EventSetup &, unsigned int)
virtual void doEndLuminosityBlock(edm::LuminosityBlockPrincipal &, edm::EventSetup const &)
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
Called after all event modules have processed the begin of a Run.
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