36 #include "TEveManager.h"
37 #include "TEveEventManager.h"
38 #include "TEveTrackPropagator.h"
39 #include "TGLWidget.h"
41 #include "TEveBrowser.h"
45 class CmsEveMagField :
public TEveMagField
53 CmsEveMagField() : TEveMagField(), fField(-3.8), fFieldMag(3.8) {}
54 virtual ~CmsEveMagField() {}
57 void SetFieldByCurrent(Float_t avg_current)
59 fField = -3.8 * avg_current / 18160.0;
60 fFieldMag = TMath::Abs(fField);
64 virtual Float_t GetMaxFieldMag()
const
69 virtual TEveVector GetField(Float_t
x, Float_t
y, Float_t
z)
const
71 static const Float_t barrelFac = 1.2 / 3.8;
72 static const Float_t endcapFac = 2.0 / 3.8;
74 const Float_t
R =
sqrt(x*x+y*y);
75 const Float_t absZ = TMath::Abs(z);
81 if (R < 300.0
f)
return TEveVector(0, 0, fField);
84 if ((R > 461.0
f && R < 490.5
f) ||
85 (R > 534.5
f && R < 597.5
f) ||
86 (R > 637.0
f && R < 700.0
f))
88 return TEveVector(0, 0, -fField*barrelFac);
91 if ((absZ > 724.0
f && absZ < 786.0
f) ||
92 (absZ > 850.0
f && absZ < 910.0
f) ||
93 (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);
120 m_context(new fireworks::
Context(changeManager(),
124 m_metadataManager.
get())),
125 m_Rint(m_appHelper->app()),
139 const char *releaseBase = getenv(
"CMSSW_RELEASE_BASE");
140 const char *workarea = getenv(
"CMSSW_BASE");
141 std::string displayConfigRelFilename =
"/src/Fireworks/FWInterface/macros/ffw.fwc";
142 std::string geometryRelFilename =
"/src/Fireworks/FWInterface/data/cmsGeom10.root";
144 std::string displayConfigFilename =
"ffw.fwc";
147 if (releaseBase && access((releaseBase + displayConfigFilename).c_str(), R_OK) == 0)
148 displayConfigFilename = releaseBase + displayConfigRelFilename;
149 if (workarea && access((workarea + displayConfigRelFilename).c_str(), R_OK) == 0)
150 displayConfigFilename = workarea + displayConfigRelFilename;
152 if (releaseBase && access((releaseBase + geometryRelFilename).c_str(), R_OK) == 0)
153 geometryFilename = releaseBase + geometryRelFilename;
154 if (workarea && access((workarea + geometryRelFilename).c_str(), R_OK) == 0)
155 geometryFilename = workarea + geometryRelFilename;
157 displayConfigFilename = ps.
getUntrackedParameter<std::string>(
"displayConfigFilename", displayConfigFilename);
163 if( !geometryFilename.empty())
214 f=boost::bind(&TApplication::Terminate,
m_Rint, 0);
220 gSystem->ProcessEvents();
247 if (!
guiManager()->playEventsAction()->isEnabled())
262 if (!reachedEnd ||
loop())
339 printf(
"Got current from conds in edm %f\n", runCond->BAvgCurrent);
340 current = runCond->BAvgCurrent;
344 printf(
"Could not extract run-conditions get-result=%d, is-valid=%d\n", res, runCond.
isValid());
352 current = sum->m_avg_current;
353 printf(
"Got current from RunInfoRcd %f\n", sum->m_avg_current);
357 static_cast<CmsEveMagField*
>(
m_MagField)->SetFieldByCurrent(current);
void startAutoLoadTimer()
TEveMagField * getMagField()
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 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
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.
bool getByType(Handle< PROD > &result) const
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.
T const * product() const
void setFilterButtonText(const char *txt)
CSGContinuousAction * playEventsAction()
virtual edm::EDLooperBase::Status endOfLoop(const edm::EventSetup &, unsigned int)
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)
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
const std::string * moduleLabel() const